You are here

public function PHPExcel_Chart::render in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Chart.php \PHPExcel_Chart::render()

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Chart.php, line 611

Class

PHPExcel_Chart
PHPExcel_Chart

Code

public function render($outputDestination = null) {
  $libraryName = PHPExcel_Settings::getChartRendererName();
  if (is_null($libraryName)) {
    return false;
  }

  //	Ensure that data series values are up-to-date before we render
  $this
    ->refresh();
  $libraryPath = PHPExcel_Settings::getChartRendererPath();
  $includePath = str_replace('\\', '/', get_include_path());
  $rendererPath = str_replace('\\', '/', $libraryPath);
  if (strpos($rendererPath, $includePath) === false) {
    set_include_path(get_include_path() . PATH_SEPARATOR . $libraryPath);
  }
  $rendererName = 'PHPExcel_Chart_Renderer_' . $libraryName;
  $renderer = new $rendererName($this);
  if ($outputDestination == 'php://output') {
    $outputDestination = null;
  }
  return $renderer
    ->render($outputDestination);
}