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


PHP pData::addSeries方法代码示例

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


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

示例1: testRemoveSeries

 public function testRemoveSeries()
 {
     $data = new pData();
     $data->addPoint(array(1, 2), 'testseries1');
     $data->addPoint(array(3, 4), 'testseries2');
     $data->addSeries('testseries1');
     $data->addSeries('testseries2');
     $this->assertEquals(array('Position' => 'Name', 'Format' => array('X' => 'number', 'Y' => 'number'), 'Unit' => array('X' => null, 'Y' => null), 'Values' => array('testseries1', 'testseries2')), $data->getDataDescription());
     $data->removeSeries('testseries1');
     $this->assertEquals(array('Position' => 'Name', 'Format' => array('X' => 'number', 'Y' => 'number'), 'Unit' => array('X' => null, 'Y' => null), 'Values' => array(1 => 'testseries2')), $data->getDataDescription());
 }
开发者ID:han905,项目名称:pChart-php5,代码行数:11,代码来源:pDataTest.php

示例2: testRemoveSeries

 public function testRemoveSeries()
 {
     $data = new pData();
     $data->addPoints(array(1, 2), 'testseries1');
     $data->addPoints(array(3, 4), 'testseries2');
     $data->addSeries('testseries1');
     $data->addSeries('testseries2');
     $this->assertEquals(array('testseries1', 'testseries2'), $data->getDataDescription()->values);
     $this->assertEquals(null, $data->getDataDescription()->description);
     $data->removeSeries('testseries1');
     $this->assertEquals(array(1 => 'testseries2'), $data->getDataDescription()->values);
 }
开发者ID:rbraband,项目名称:pChart,代码行数:12,代码来源:pDataTest.php

示例3: testDrawXYPlotGraph

 public function testDrawXYPlotGraph()
 {
     $dataSet = new pData();
     $dataSet->addPoints(array(1, 3, 2, 6, 3, 1), 'X');
     $dataSet->addPoints(array(5, 2, 4, 12, 7, 3), 'Y');
     $dataSet->addSeries('X');
     $dataSet->addSeries('Y');
     $canvas = new TestCanvas();
     $chart = new pChart(300, 300, $canvas);
     $chart->setFontProperties('Fonts/tahoma.ttf', 8);
     $chart->setGraphArea(55, 30, 270, 230);
     $scaleStyle = new ScaleStyle(SCALE_NORMAL, new Color(213, 217, 221));
     $chart->drawXYScale($dataSet, $scaleStyle, 'Y', 'X', 45);
     $backgroundStyle = new BackgroundStyle(new Color(213, 217, 221), FALSE);
     $chart->drawGraphBackground($backgroundStyle);
     $chart->drawGrid(new GridStyle(4, TRUE, new Color(230), 20));
     $chart->drawXYPlotGraph($dataSet->getData(), 'Y', 'X');
     file_put_contents(dirname(__FILE__) . '/action_logs/testDrawXYPlotGraph', $canvas->getActionLog());
     $this->assertEquals('a769bf6298734bb20665fc27f7f462ab', md5($canvas->getActionLog()));
 }
开发者ID:rbraband,项目名称:pChart,代码行数:20,代码来源:pChartTest.php


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