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


PHP pData::setSeriesName方法代碼示例

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


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

示例1: testDrawBarGraph

 public function testDrawBarGraph()
 {
     // Dataset definition
     $DataSet = new pData();
     $DataSet->addPoints(array(1, 4, -3, 2, -3, 3, 2, 1, 0, 7, 4), "Serie1");
     $DataSet->addPoints(array(3, 3, -4, 1, -2, 2, 1, 0, -1, 6, 3), "Serie2");
     $DataSet->addPoints(array(4, 1, 2, -1, -4, -2, 3, 2, 1, 2, 2), "Serie3");
     $DataSet->AddAllSeries();
     $DataSet->SetAbscissaLabelSeries();
     $DataSet->setSeriesName("January", "Serie1");
     $DataSet->setSeriesName("February", "Serie2");
     $DataSet->setSeriesName("March", "Serie3");
     // Initialise the graph
     $canvas = new TestCanvas();
     $Test = new pChart(700, 230, $canvas);
     $Test->setFontProperties("Fonts/tahoma.ttf", 8);
     $Test->setGraphArea(50, 30, 680, 200);
     $canvas->drawFilledRoundedRectangle(new Point(7, 7), new Point(693, 223), 5, new Color(240), 1, 0, ShadowProperties::NoShadow());
     $backgroundStyle = new BackgroundStyle(new Color(255), TRUE);
     $Test->drawGraphBackground($backgroundStyle);
     $Test->drawScale($DataSet, ScaleStyle::DefaultStyle(), 0, 2, TRUE);
     $Test->drawGrid(new GridStyle(4, TRUE, new Color(230), 50));
     // Draw the 0 line
     $Test->setFontProperties("Fonts/tahoma.ttf", 6);
     $Test->drawTreshold(0, new Color(143, 55, 72), TRUE, TRUE);
     // Draw the bar graph
     $Test->drawBarGraph($DataSet->GetData(), $DataSet->GetDataDescription(), TRUE, 80);
     // Finish the graph
     $Test->setFontProperties("Fonts/tahoma.ttf", 8);
     $Test->drawLegend(596, 150, $DataSet->GetDataDescription(), new Color(255));
     $Test->setFontProperties("Fonts/tahoma.ttf", 10);
     $Test->drawTitle(50, 22, "Example 12", new Color(50), 585);
     $this->assertEquals('c5cc595cf2c41c6c363521346c8262a5', md5($canvas->getActionLog()));
 }
開發者ID:rbraband,項目名稱:pChart,代碼行數:34,代碼來源:pChartTest.php


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