JpGraph

JpGraph is an object-oriented graph generation library. The library is completely written in PHP and ready to be used in any PHP scripts (both CGI/APXS/CLI versions of PHP are supported). The library can be used to create numerous types of graphs either on-line or written to a file. JpGraph makes it easy to draw both "quick and dirty" graphs with a minimum of code as well as complex graphs which requires a very fine grained control. The library assigns context-sensitive default values for most of the parameters which minimizes the learning curve.

Example

require_once("jpgraph/jpgraph.php");

require_once("jpgraph/jpgraph_line.php");

$ydata = array(12,25,2,44,22,100);

// Create the graph. These two calls are always required
$graph = new Graph(350,250,"auto"); $graph->SetScale("textlin");

// Setup title
$graph->title->Set('Line Graph');

// Create the linear plot
$lineplot=new LinePlot($ydata);
$lineplot->SetColor("blue");

// Add the plot to the graph
$graph->Add($lineplot);

// show the graph
$graph->Stroke();