pChart 2.x forum http://wiki.pchart.net/forum/ |
|
Variable in $DataSet->AddPoint(array($var)); http://wiki.pchart.net/forum/viewtopic.php?f=1&t=2583 |
Page 1 of 1 |
Author: | xna8f [ Sun Apr 01, 2012 8:02 pm ] |
Post subject: | Variable in $DataSet->AddPoint(array($var)); |
I am trying to do the below but it isn't working for some reason, is it possible to use variables in the AddPoint section? Code: <?php // Standard inclusions include("pChart/pData.class"); include("pChart/pChart.class"); // Dataset definition $var= "1,2,3,4,5"; $DataSet = new pData; $DataSet->AddPoint(array($var)); $DataSet->AddSerie(); $DataSet->SetSerieName("Response Time","Serie1"); // Initialise the graph $Test = new pChart(700,230); $Test->setFontProperties("Fonts/tahoma.ttf",10); $Test->setGraphArea(40,30,680,200); $Test->drawGraphArea(252,252,252); $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),5,150,150,150,TRUE,0,2); $Test->drawGrid(4,TRUE,230,230,230,255); // Draw the line graph $Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription()); $Test->drawPlotGraph($DataSet->GetData(),$DataSet->GetDataDescription(),3,2,255,255,255); // Finish the graph $Test->setFontProperties("Fonts/tahoma.ttf",10); $Test->drawLegend(65,35,$DataSet->GetDataDescription(),255,255,255); $Test->drawTitle(60,22,"XNA8F Server Respnose",50,50,50,585); $Test->Render("Naked.png"); ?> <img src="naked.png" /> |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |