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


PHP pData::removeSeries方法代碼示例

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


在下文中一共展示了pData::removeSeries方法的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: accessgraph

 /**
  * Draws a line or bargraph depending on the number of data points
  *
  * @param string $title the graph's title
  * @param array  $axis the axis points
  * @param array  $labels the labels for the datasets
  * @param array  $datasets any number of data arrays
  */
 private function accessgraph($title, $axis, $labels, $datasets)
 {
     if (!count($axis)) {
         $this->nograph($title . ': no data');
         return;
     }
     // add the data and labels
     $DataSet = new pData();
     foreach ($datasets as $num => $set) {
         $DataSet->AddPoints($set, "series{$num}");
         $DataSet->SetSeriesName($labels[$num], "series{$num}");
     }
     // setup axis
     $DataSet->AddPoints($axis, 'times');
     $DataSet->AddAllSeries();
     $DataSet->SetAbscissaLabelSeries('times');
     $DataSet->removeSeries('times');
     $DataSet->removeSeriesName('times');
     $Canvas = new GDCanvas(600, 300, false);
     $Chart = new pChart(600, 300, $Canvas);
     $usebargraph = count($axis) < 10;
     $Chart->setFontProperties(dirname(__FILE__) . '/../pchart/Fonts/DroidSans.ttf', 8);
     $Chart->setGraphArea(50, 40, 500, 200);
     $Chart->drawScale($DataSet, new ScaleStyle(SCALE_NORMAL, new Color(127)), 45, 1, $usebargraph);
     if ($usebargraph) {
         $Chart->drawBarGraph($DataSet->GetData(), $DataSet->GetDataDescription());
     } else {
         $Chart->drawLineGraph($DataSet->GetData(), $DataSet->GetDataDescription());
     }
     $Chart->drawLegend(500, 40, $DataSet->GetDataDescription(), new Color(250));
     $Chart->setFontProperties(dirname(__FILE__) . '/../pchart/Fonts/DroidSans.ttf', 12);
     $Chart->drawTitle(10, 10, $title, new Color(0), 590, 30);
     $Chart->Render(null);
 }
開發者ID:omusico,項目名稱:isle-web-framework,代碼行數:42,代碼來源:graph.php


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