source: trunk/xgraph/jpgraph/Examples/odotutex03.php @ 42

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 905 bytes
Line 
1<?php
2require_once ('jpgraph/jpgraph.php');
3require_once ('jpgraph/jpgraph_odo.php');
4
5// Create a new odometer graph (width=250, height=200 pixels)
6$graph = new OdoGraph(250,200);
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.This is a very, very\nlong text with multiples lines\nthat are added as a caption.");
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.