The basic idea is that you generate the graph in a .php file and then refer to that page as it would be an image. For example, create your graph in graph.php as:
<?php
// graph.php: generating the graph
require_once("jpgraph_here.php");
$chart = new cls_Chart();
// bulding the graph
// showing it:
$chart->Paint();
?>
Then, if you want to display it in graph_container.php then make it like this:
<?php
// prezenting the graph
<html>
<body>
<p>Your html code before the graph</p>
<img src="graph.php">
<p>Your html code after the graph</p>
</body>
</html>
?>
Make sure not leaving any whitespace in graph.php in order to avoid sending unnecessary headers.
Maybe you are wondering how to transmit some parameters to graph.php. Simply through the query string. I mean:
<img src="grap.php?function=log">
Then use $_GET['function'] in graph.php.
To be sure that the images with the same query strings are not taken from the cache by the broser, try this:
<img src="grap.php?function=log&rnd=<?=time()?>">
as time() assures the randomness of the URL.
The above story is successfully working at me. If needed, ask more!
sbaba13