You are here

public function PHPExcel_Worksheet::getChartByName in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php \PHPExcel_Worksheet::getChartByName()

Get a chart by name

Parameters

string $chartName Chart name:

Return value

false|PHPExcel_Chart

Throws

PHPExcel_Exception

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php, line 644

Class

PHPExcel_Worksheet
PHPExcel_Worksheet

Code

public function getChartByName($chartName = '') {
  $chartCount = count($this->_chartCollection);
  if ($chartCount == 0) {
    return false;
  }
  foreach ($this->_chartCollection as $index => $chart) {
    if ($chart
      ->getName() == $chartName) {
      return $this->_chartCollection[$index];
    }
  }
  return false;
}