nabster
New pChart user
Joined: Wed Jan 15, 2014 4:15 am Posts: 2
|
Small Graph
G'day, I am going in a loop and generating small fast graphs. It seems that the all the graphs that are generated after the first one are simply copies of the first. It doesn't seem to redraw the graph with new data. How can i call this program with different data array to plot different small graphs on the same page?
mygraph.php <?php // Standard inclusions include("pchart/classnew/pData.class"); include("pchart/classnew/pChart.class");
// Dataset definition $DataSet = new pData();
// SESSION['USEDGB'] changes each loop in the calling program $DataSet->AddPoint($_SESSION['USEDGBD'],"Disk"); $DataSet->AddAllSeries(); $DataSet->SetAbsciseLabelSerie(); $DataSet->SetSerieName("CapturedData","Disk");
// Initialise the graph $Test = new pChart(100,30); $Test->loadColorPalette("pchart/palettes/spring.color", TRUE); $Test->setFontProperties("Fonts/tahoma.ttf",8); $Test->drawFilledRoundedRectangle(2,2,98,28,2,230,230,230); $Test->setGraphArea(5,5,95,25); $Test->drawGraphArea(255,255,255); $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,150,150,150,FALSE,0,2); // Draw the line graph $Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
// Finish the graph $Test->stroke("pictures/".$_SESSION['compid']."name.png"); ?>
|
ibilima
pChart user
Joined: Mon Jun 04, 2012 5:41 pm Posts: 6
|
Re: Small Graph
I am by no means an expert on pchart. But, maybe a suggestion may help or spark an idea for you?
Are you using an "img src=" statement in another PHP to call this one? I have multiple charts on one of my pages, and I use this method. Also, perhaps changing the name of this php image to be different each time(like adding the timestamp), may force it to create a new image?
|
nabster
New pChart user
Joined: Wed Jan 15, 2014 4:15 am Posts: 2
|
Re: Small Graph
Thanks for your suggestion. But that $_SESSION['compid'] is just that which changes each time so the image name is definitely different.
Any other pointers?
|