當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PiePlot::SetColor方法代碼示例

本文整理匯總了PHP中PiePlot::SetColor方法的典型用法代碼示例。如果您正苦於以下問題:PHP PiePlot::SetColor方法的具體用法?PHP PiePlot::SetColor怎麽用?PHP PiePlot::SetColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PiePlot的用法示例。


在下文中一共展示了PiePlot::SetColor方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createPlot

 public function createPlot()
 {
     $size = '0.25';
     $plot = new \PiePlot($this->data);
     $plot->SetLegends($this->legends);
     $plot->SetSize($size);
     $plot->SetCenter(0.25, 0.32);
     $plot->ShowBorder();
     $plot->SetColor('black');
     $this->grafico->add($plot);
 }
開發者ID:evandrolacerda,項目名稱:caps_laravel,代碼行數:11,代碼來源:GraficoPizza.php

示例2: _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->SetColor(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:s-kalaus,項目名稱:ekernel,代碼行數:66,代碼來源:jpgraph.php


注:本文中的PiePlot::SetColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。