You are here

private static function PHPExcel_Writer_Excel2007_Chart::_getChartType in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Chart.php \PHPExcel_Writer_Excel2007_Chart::_getChartType()

Get the data series type(s) for a chart plot series

Parameters

PHPExcel_Chart_PlotArea $plotArea:

Return value

string|array

Throws

PHPExcel_Writer_Exception

1 call to PHPExcel_Writer_Excel2007_Chart::_getChartType()
PHPExcel_Writer_Excel2007_Chart::_writePlotArea in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Chart.php
Write Chart Plot Area

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Chart.php, line 1056

Class

PHPExcel_Writer_Excel2007_Chart
PHPExcel_Writer_Excel2007_Chart

Code

private static function _getChartType($plotArea) {
  $groupCount = $plotArea
    ->getPlotGroupCount();
  if ($groupCount == 1) {
    $chartType = array(
      $plotArea
        ->getPlotGroupByIndex(0)
        ->getPlotType(),
    );
  }
  else {
    $chartTypes = array();
    for ($i = 0; $i < $groupCount; ++$i) {
      $chartTypes[] = $plotArea
        ->getPlotGroupByIndex($i)
        ->getPlotType();
    }
    $chartType = array_unique($chartTypes);
    if (count($chartTypes) == 0) {
      throw new PHPExcel_Writer_Exception('Chart is not yet implemented');
    }
  }
  return $chartType;
}