View unanswered posts | View active topics It is currently Sun Nov 19, 2017 8:36 am



Reply to topic  [ 3 posts ] 
Small Graph 
Author Message
New pChart user
New pChart user

Joined: Wed Jan 15, 2014 4:15 am
Posts: 2
Post 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");
?>


Wed Jan 15, 2014 4:20 am
Profile
pChart user
pChart user

Joined: Mon Jun 04, 2012 5:41 pm
Posts: 6
Post 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?


Wed Jan 15, 2014 1:10 pm
Profile
New pChart user
New pChart user

Joined: Wed Jan 15, 2014 4:15 am
Posts: 2
Post 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?


Wed Jan 15, 2014 10:11 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron