source: trunk/xgraph/jpgraph/Examples/odoex00.php

Last change on this file was 42, checked in by marrucho, 10 years ago
File size: 1.8 KB
Line 
1<?php
2//=============================================================================
3// File:        ODOEX00.PHP
4// Description: Example 0 for odometer graphs
5// Created:     2002-02-22
6// Version:     $Id$
7//
8// Comment:
9// Example file for odometer graph. This examples demonstrates the simplest
10// possible graph using all default values for colors, sizes etc.
11//
12// Copyright (C) 2002 Johan Persson. All rights reserved.
13//=============================================================================
14require_once ('jpgraph/jpgraph.php');
15require_once ('jpgraph/jpgraph_odo.php');
16
17//---------------------------------------------------------------------
18// Create a new odometer graph (width=250, height=200 pixels)
19//---------------------------------------------------------------------
20$graph = new OdoGraph(250,130);
21$graph->SetColor('white');
22$graph->SetMarginColor('white');
23$graph->SetFrame(false);
24
25//---------------------------------------------------------------------
26// Now we need to create an odometer to add to the graph.
27// By default the scale will be 0 to 100
28//---------------------------------------------------------------------
29$odo = new Odometer(); 
30
31//---------------------------------------------------------------------
32// Set display value for the odometer
33//---------------------------------------------------------------------
34$odo->needle->Set(40);
35
36//---------------------------------------------------------------------
37// Add the odometer to the graph
38//---------------------------------------------------------------------
39$graph->Add($odo);
40
41//---------------------------------------------------------------------
42// ... and finally stroke and stream the image back to the browser
43//---------------------------------------------------------------------
44$graph->Stroke();
45
46// EOF
47?>
Note: See TracBrowser for help on using the repository browser.