You are here

private function PHPExcel_Chart_Renderer_jpgraph::_percentageSumCalculation in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/jpgraph.php \PHPExcel_Chart_Renderer_jpgraph::_percentageSumCalculation()
2 calls to PHPExcel_Chart_Renderer_jpgraph::_percentageSumCalculation()
PHPExcel_Chart_Renderer_jpgraph::_renderPlotBar in vendor/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/jpgraph.php
PHPExcel_Chart_Renderer_jpgraph::_renderPlotLine in vendor/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/jpgraph.php

File

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

Class

PHPExcel_Chart_Renderer_jpgraph
PHPExcel_Chart_Renderer_jpgraph

Code

private function _percentageSumCalculation($groupID, $seriesCount) {

  //	Adjust our values to a percentage value across all series in the group
  for ($i = 0; $i < $seriesCount; ++$i) {
    if ($i == 0) {
      $sumValues = $this->_chart
        ->getPlotArea()
        ->getPlotGroupByIndex($groupID)
        ->getPlotValuesByIndex($i)
        ->getDataValues();
    }
    else {
      $nextValues = $this->_chart
        ->getPlotArea()
        ->getPlotGroupByIndex($groupID)
        ->getPlotValuesByIndex($i)
        ->getDataValues();
      foreach ($nextValues as $k => $value) {
        if (isset($sumValues[$k])) {
          $sumValues[$k] += $value;
        }
        else {
          $sumValues[$k] = $value;
        }
      }
    }
  }
  return $sumValues;
}