Rev | Line | |
---|
[42] | 1 | <?php
|
---|
| 2 | require_once ('jpgraph/jpgraph.php');
|
---|
| 3 | require_once ('jpgraph/jpgraph_odo.php');
|
---|
| 4 |
|
---|
| 5 | // Create a new odometer graph (width=250, height=200 pixels)
|
---|
| 6 | $graph = new OdoGraph(250,180);
|
---|
| 7 |
|
---|
| 8 | // Setup titles
|
---|
| 9 | $graph->title->Set("Result for 2002");
|
---|
| 10 | $graph->title->SetColor("white");
|
---|
| 11 | $graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
|
---|
| 12 | $graph->subtitle->Set("New York Office");
|
---|
| 13 | $graph->subtitle->SetColor("white");
|
---|
| 14 | $graph->caption->Set("Figure 1. Branch results.");
|
---|
| 15 | $graph->caption->SetColor("white");
|
---|
| 16 |
|
---|
| 17 | // Now we need to create an odometer to add to the graph.
|
---|
| 18 | // By default the scale will be 0 to 100
|
---|
| 19 | $odo = new Odometer();
|
---|
| 20 |
|
---|
| 21 | // Set display value for the odometer
|
---|
| 22 | $odo->needle->Set(30);
|
---|
| 23 |
|
---|
| 24 | // Add the odometer to the graph
|
---|
| 25 | $graph->Add($odo);
|
---|
| 26 |
|
---|
| 27 | // ... and finally stroke and stream the image back to the client
|
---|
| 28 | $graph->Stroke();
|
---|
| 29 |
|
---|
| 30 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.