trixs
Feb 18th 2008, 10:45 am
Hey all,
I'm having a little issue that I could use a mind jogger with. I am trying to add some dynamic charts to a site I am working on. All the data is already generated in various classes and all I need to do is add the charts. Looking at various scripts (http://www.ebrueggeman.com/phpgraphlib/examples.php) it seems that they all call a php script from within an IMG tag..
<?php
include("phpgraphlib.php");
$graph=new PHPGraphLib(500,350);
$data=array(12124,5535,43373,22223,90432,23332,15544,24523,32778,38878,28787,33243,34832,32302);
$graph->addData($data);
$graph->setTitle("Widgets Produced");
$graph->setGradient("red", "maroon");
$graph->createGraph();
?>
The above would be its own file and then called by something like:
<html>
<img src="graph_bar.php" />
</html>
What I can not figure out for the life of me is how I could get the data I actually want to display from my main program to this side chart. The only options I can think of are:
1. Write it to a databae and then call it from the chart php script. Not efficient at all.
2. Write all the data to cookies lol
3. Create my own charting script - lots of work!
Any ideas?
I'm having a little issue that I could use a mind jogger with. I am trying to add some dynamic charts to a site I am working on. All the data is already generated in various classes and all I need to do is add the charts. Looking at various scripts (http://www.ebrueggeman.com/phpgraphlib/examples.php) it seems that they all call a php script from within an IMG tag..
<?php
include("phpgraphlib.php");
$graph=new PHPGraphLib(500,350);
$data=array(12124,5535,43373,22223,90432,23332,15544,24523,32778,38878,28787,33243,34832,32302);
$graph->addData($data);
$graph->setTitle("Widgets Produced");
$graph->setGradient("red", "maroon");
$graph->createGraph();
?>
The above would be its own file and then called by something like:
<html>
<img src="graph_bar.php" />
</html>
What I can not figure out for the life of me is how I could get the data I actually want to display from my main program to this side chart. The only options I can think of are:
1. Write it to a databae and then call it from the chart php script. Not efficient at all.
2. Write all the data to cookies lol
3. Create my own charting script - lots of work!
Any ideas?