You are here

private function PHPExcel_Chart_Renderer_jpgraph::_formatDataSetLabels 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::_formatDataSetLabels()
4 calls to PHPExcel_Chart_Renderer_jpgraph::_formatDataSetLabels()
PHPExcel_Chart_Renderer_jpgraph::_renderPieChart in vendor/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/jpgraph.php
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
PHPExcel_Chart_Renderer_jpgraph::_renderPlotStock in vendor/phpoffice/phpexcel/Classes/PHPExcel/Chart/Renderer/jpgraph.php

File

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

Class

PHPExcel_Chart_Renderer_jpgraph
PHPExcel_Chart_Renderer_jpgraph

Code

private function _formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation = '') {
  $datasetLabelFormatCode = $this->_chart
    ->getPlotArea()
    ->getPlotGroupByIndex($groupID)
    ->getPlotCategoryByIndex(0)
    ->getFormatCode();
  if (!is_null($datasetLabelFormatCode)) {

    //	Retrieve any label formatting code
    $datasetLabelFormatCode = stripslashes($datasetLabelFormatCode);
  }
  $testCurrentIndex = 0;
  foreach ($datasetLabels as $i => $datasetLabel) {
    if (is_array($datasetLabel)) {
      if ($rotation == 'bar') {
        $datasetLabels[$i] = implode(" ", $datasetLabel);
      }
      else {
        $datasetLabel = array_reverse($datasetLabel);
        $datasetLabels[$i] = implode("\n", $datasetLabel);
      }
    }
    else {

      //	Format labels according to any formatting code
      if (!is_null($datasetLabelFormatCode)) {
        $datasetLabels[$i] = PHPExcel_Style_NumberFormat::toFormattedString($datasetLabel, $datasetLabelFormatCode);
      }
    }
    ++$testCurrentIndex;
  }
  return $datasetLabels;
}