[42] | 1 | <?php // content="text/plain; charset=utf-8" |
---|
| 2 | require_once ('jpgraph/jpgraph.php'); |
---|
| 3 | require_once ('jpgraph/jpgraph_line.php'); |
---|
| 4 | |
---|
| 5 | // Some data |
---|
| 6 | $ydata = array(11,3,8,12,5,1,9,13,5,7); |
---|
| 7 | |
---|
| 8 | // Create the graph. These two calls are always required |
---|
| 9 | $graph = new Graph(200,150); |
---|
| 10 | $graph->SetScale("textlin"); |
---|
| 11 | $graph->SetMargin(25,10,30,30); |
---|
| 12 | |
---|
| 13 | $graph->title->SetFont(FF_ARIAL,FS_BOLD,12); |
---|
| 14 | $graph->title->Set('The Title'); |
---|
| 15 | $graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,10); |
---|
| 16 | $graph->subtitle->Set('The Subtitle'); |
---|
| 17 | $graph->subsubtitle->SetFont(FF_ARIAL,FS_ITALIC,9); |
---|
| 18 | $graph->subsubtitle->Set('The Subsubitle'); |
---|
| 19 | |
---|
| 20 | // Create the linear plot |
---|
| 21 | $lineplot=new LinePlot($ydata); |
---|
| 22 | $lineplot->SetColor("blue"); |
---|
| 23 | |
---|
| 24 | // Add the plot to the graph |
---|
| 25 | $graph->Add($lineplot); |
---|
| 26 | |
---|
| 27 | // Display the graph |
---|
| 28 | $graph->Stroke(); |
---|
| 29 | ?> |
---|