You are here

private function PHPExcel_Chart_Renderer_jpgraph::_renderPlotRadar in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/jpgraph.php \PHPExcel_Chart_Renderer_jpgraph::_renderPlotRadar()
1 call to PHPExcel_Chart_Renderer_jpgraph::_renderPlotRadar()
PHPExcel_Chart_Renderer_jpgraph::_renderRadarChart in vendor/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/jpgraph.php

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/jpgraph.php, line 459

Class

PHPExcel_Chart_Renderer_jpgraph
PHPExcel_Chart_Renderer_jpgraph

Code

private function _renderPlotRadar($groupID) {
  $radarStyle = $this->_chart
    ->getPlotArea()
    ->getPlotGroupByIndex($groupID)
    ->getPlotStyle();
  $seriesCount = $this->_chart
    ->getPlotArea()
    ->getPlotGroupByIndex($groupID)
    ->getPlotSeriesCount();
  $seriesPlots = array();

  //	Loop through each data series in turn
  for ($i = 0; $i < $seriesCount; ++$i) {
    $dataValuesY = $this->_chart
      ->getPlotArea()
      ->getPlotGroupByIndex($groupID)
      ->getPlotCategoryByIndex($i)
      ->getDataValues();
    $dataValuesX = $this->_chart
      ->getPlotArea()
      ->getPlotGroupByIndex($groupID)
      ->getPlotValuesByIndex($i)
      ->getDataValues();
    $marker = $this->_chart
      ->getPlotArea()
      ->getPlotGroupByIndex($groupID)
      ->getPlotValuesByIndex($i)
      ->getPointMarker();
    $dataValues = array();
    foreach ($dataValuesY as $k => $dataValueY) {
      $dataValues[$k] = implode(' ', array_reverse($dataValueY));
    }
    $tmp = array_shift($dataValues);
    $dataValues[] = $tmp;
    $tmp = array_shift($dataValuesX);
    $dataValuesX[] = $tmp;
    $this->_graph
      ->SetTitles(array_reverse($dataValues));
    $seriesPlot = new RadarPlot(array_reverse($dataValuesX));
    $dataLabel = $this->_chart
      ->getPlotArea()
      ->getPlotGroupByIndex($groupID)
      ->getPlotLabelByIndex($i)
      ->getDataValue();
    $seriesPlot
      ->SetColor(self::$_colourSet[self::$_plotColour++]);
    if ($radarStyle == 'filled') {
      $seriesPlot
        ->SetFillColor(self::$_colourSet[self::$_plotColour]);
    }
    $this
      ->_formatPointMarker($seriesPlot, $marker);
    $seriesPlot
      ->SetLegend($dataLabel);
    $this->_graph
      ->Add($seriesPlot);
  }
}