当前位置: 首页>>代码示例>>PHP>>正文


PHP PiePlot::setBackgroundColor方法代码示例

本文整理汇总了PHP中PiePlot::setBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:PHP PiePlot::setBackgroundColor方法的具体用法?PHP PiePlot::setBackgroundColor怎么用?PHP PiePlot::setBackgroundColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PiePlot的用法示例。


在下文中一共展示了PiePlot::setBackgroundColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _renderPieChart

 private function _renderPieChart($groupCount, $dimensions = '2d', $doughnut = False, $multiplePlots = False)
 {
     require_once 'jpgraph_pie.php';
     if ($dimensions == '3d') {
         require_once 'jpgraph_pie3d.php';
     }
     $this->_renderPiePlotArea($doughnut);
     $iLimit = $multiplePlots ? $groupCount : 1;
     for ($groupID = 0; $groupID < $iLimit; ++$groupID) {
         $grouping = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
         $exploded = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
         if ($groupID == 0) {
             $labelCount = count($this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
             if ($labelCount > 0) {
                 $datasetLabels = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
                 $datasetLabels = $this->_formatDataSetLabels($groupID, $datasetLabels, $labelCount);
             }
         }
         $seriesCount = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
         $seriesPlots = array();
         //	For pie charts, we only display the first series: doughnut charts generally display all series
         $jLimit = $multiplePlots ? $seriesCount : 1;
         //	Loop through each data series in turn
         for ($j = 0; $j < $jLimit; ++$j) {
             $dataValues = $this->_chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($j)->getDataValues();
             //	Fill in any missing values in the $dataValues array
             $testCurrentIndex = 0;
             foreach ($dataValues as $k => $dataValue) {
                 while ($k != $testCurrentIndex) {
                     $dataValues[$testCurrentIndex] = null;
                     ++$testCurrentIndex;
                 }
                 ++$testCurrentIndex;
             }
             if ($dimensions == '3d') {
                 $seriesPlot = new PiePlot3D($dataValues);
             } else {
                 if ($doughnut) {
                     $seriesPlot = new PiePlotC($dataValues);
                 } else {
                     $seriesPlot = new PiePlot($dataValues);
                 }
             }
             if ($multiplePlots) {
                 $seriesPlot->SetSize(($jLimit - $j) / ($jLimit * 4));
             }
             if ($doughnut) {
                 $seriesPlot->SetMidColor('white');
             }
             $seriesPlot->setBackgroundColor(self::$_colourSet[self::$_plotColour++]);
             if (count($datasetLabels) > 0) {
                 $seriesPlot->SetLabels(array_fill(0, count($datasetLabels), ''));
             }
             if ($dimensions != '3d') {
                 $seriesPlot->SetGuideLines(false);
             }
             if ($j == 0) {
                 if ($exploded) {
                     $seriesPlot->ExplodeAll();
                 }
                 $seriesPlot->SetLegends($datasetLabels);
             }
             $this->_graph->Add($seriesPlot);
         }
     }
 }
开发者ID:jjechev,项目名称:phpTdConvert,代码行数:66,代码来源:jpgraph.php


注:本文中的PiePlot::setBackgroundColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。