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


PHP pChart::drawBackgroundGradient方法代码示例

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


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

示例1: testXYChart

 /**
  * Based on Example24.php
  */
 public function testXYChart()
 {
     // Dataset definition
     $DataSet = new pData();
     // Compute the points
     for ($i = 0; $i <= 360; $i = $i + 10) {
         $DataSet->addPoint(cos($i * 3.14 / 180) * 80 + $i, "Serie1");
         $DataSet->addPoint(sin($i * 3.14 / 180) * 80 + $i, "Serie2");
     }
     $DataSet->setSeriesName("Trigonometric function", "Serie1");
     $DataSet->addSeries("Serie1");
     $DataSet->addSeries("Serie2");
     $DataSet->SetXAxisName("X Axis");
     $DataSet->SetYAxisName("Y Axis");
     // Initialise the graph
     $canvas = new TestCanvas();
     $Test = new pChart(300, 300, $canvas);
     $Test->drawBackgroundGradient(new Color(0), -100);
     // Prepare the graph area
     $Test->setFontProperties("Fonts/tahoma.ttf", 8);
     $Test->setGraphArea(55, 30, 270, 230);
     $scaleStyle = new ScaleStyle(SCALE_NORMAL, new Color(213, 217, 221));
     $Test->drawXYScale($DataSet, $scaleStyle, "Serie1", "Serie2", 45);
     $backgroundStyle = new BackgroundStyle(new Color(213, 217, 221), FALSE, new Color(30), -50);
     $Test->drawGraphBackground($backgroundStyle);
     $Test->drawGrid(new GridStyle(4, TRUE, new Color(230), 20));
     // Draw the chart
     $Test->setShadowProperties(2, 2, new Color(0), 60, 4);
     $Test->drawXYGraph($DataSet->GetData(), "Serie1", "Serie2", 0);
     $Test->clearShadow();
     // Draw the title
     $Title = "Drawing X versus Y charts trigonometric functions  ";
     $Test->drawTextBox(new Point(0, 280), new Point(300, 300), $Title, 0, new Color(255), ALIGN_RIGHT, ShadowProperties::FromSettings(1, 1, new Color(0), 100, 0), new Color(0), 30);
     // Draw the legend
     $Test->setFontProperties("Fonts/pf_arma_five.ttf", 6);
     $DataSet->removeSeries("Serie2");
     $Test->drawLegend(160, 5, $DataSet->GetDataDescription(), new Color(0), new Color(0), new Color(255), FALSE);
     file_put_contents(dirname(__FILE__) . '/action_logs/testXYChart', $canvas->getActionLog());
     $this->assertEquals('3c45517b3d9549198ffffaac276ad353', md5($canvas->getActionLog()));
 }
开发者ID:rbraband,项目名称:pChart,代码行数:43,代码来源:pChartTest.php


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