<?php require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_odo.php'; // Create a new odometer graph (width=250, height=200 pixels) $graph = new OdoGraph(350, 100); // Add drop shadow for graph $graph->SetShadow(); // Now we need to create an odometer to add to the graph. // By default the scale will be 0 to 100 $odo1 = new Odometer(); $odo2 = new Odometer(); $odo1->SetColor("lightgray:1.9"); $odo2->SetColor("lightgray:1.9"); // Adjust start and end angle for the scale $odo2->scale->SetAngle(110, 250); $odo1->scale->label->SetFont(FF_ARIAL, FS_BOLD, 10); $odo2->scale->label->SetFont(FF_ARIAL, FS_BOLD, 10); $odo2->AddIndication(-15, 0, 'lightgray'); $odo2->AddIndication(100, 115, 'lightgray'); // Set display value for the odometer $odo1->needle->Set(70); $odo2->needle->Set(70); // Add drop shadow for needle $odo1->needle->SetShadow(); $odo2->needle->SetShadow(); // Specify the layout for the two odometers $row = new LayoutHor(array($odo1, $odo2)); // Add the odometer to the graph $graph->Add($row); // ... and finally stroke and stream the image back to the browser
// Description: Example 1 for odometer graphs // Created: 2002-02-22 // Version: $Id$ // // Comment: // Example file for odometer graph. This examples extends odoex01 // by adding several indicator bands to Trianik Planning Systemscia. // // Copyright (C) 2002 Johan Persson. All rights reserved. //============================================================================= require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_odo.php'; //--------------------------------------------------------------------- // Create a new odometer graph (width=250, height=200 pixels) //--------------------------------------------------------------------- $graph = new OdoGraph(300, 200); //--------------------------------------------------------------------- // Specify title and subtitle using default fonts // * Note each title may be multilines by using a '\n' as a line // divider. //--------------------------------------------------------------------- $graph->title->Set("Odometer title"); $graph->title->SetColor("white"); $graph->subtitle->Set("2002-02-13"); $graph->subtitle->SetColor("white"); //--------------------------------------------------------------------- // Specify caption. // * (This is the text at the bottom of the graph.) The margins will // automatically adjust to fit the height of the text. A caption // may have multiple lines by including a '\n' character in the // string.
// Created: 2002-02-22 // Version: $Id$ // // Comment: // Example file for odometer graph. This examples extends odoex05 // by changing the type of odometer to a full circle. This is as simple // as changing (less than) one line of code. // // Copyright (C) 2002 Johan Persson. All rights reserved. //============================================================================= require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_odo.php'; //--------------------------------------------------------------------- // Create a new odometer graph (width=250, height=200 pixels) //--------------------------------------------------------------------- $graph = new OdoGraph(250, 250); //--------------------------------------------------------------------- // Change the color of the odometer plotcanvas. NOT the odometer // fill color itself. //--------------------------------------------------------------------- $graph->SetColor("lightyellow"); //--------------------------------------------------------------------- // Specify title and subtitle using default fonts // * Note each title may be multilines by using a '\n' as a line // divider. //--------------------------------------------------------------------- $graph->title->Set("Odometer title"); $graph->title->SetColor("white"); $graph->subtitle->Set("2002-02-13"); $graph->subtitle->SetColor("white"); //---------------------------------------------------------------------
// Description: Example 0 for odometer graphs // Created: 2002-02-22 // Version: $Id: odoex011.php,v 1.1 2013/11/29 14:07:25 napalm Exp $ // // Comment: // Example file for odometer graph. Extends odoex10.php with graph titles // and captions and also adds individual captions for each odometer. // // Copyright (C) 2002 Johan Persson. All rights reserved. //============================================================================= require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_odo.php'; //--------------------------------------------------------------------- // Create a new odometer graph (width=200, height=400 pixels) //--------------------------------------------------------------------- $graph = new OdoGraph(200, 370); $graph->SetShadow(); //--------------------------------------------------------------------- // Specify title and subtitle using default fonts // * Note each title may be multilines by using a '\n' as a line // divider. //--------------------------------------------------------------------- $graph->title->Set("Result from 2002"); $graph->title->SetColor("white"); $graph->subtitle->Set("O1 - W-Site"); $graph->subtitle->SetColor("white"); //--------------------------------------------------------------------- // Specify caption. // * (This is the text at the bottom of the graph.) The margins will // automatically adjust to fit the height of the text. A caption // may have multiple lines by including a '\n' character in the
<?php require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_odo.php'; // Create a new odometer graph (width=250, height=200 pixels) $graph = new OdoGraph(250, 140); // Setup a title $graph->title->Set('An example with drop shadows'); // Add drop shadow for graph $graph->SetShadow(); // Set some nonstandard colors $color = array(205, 220, 205); $graph->SetMarginColor($color); $graph->SetColor($color); // Now we need to create an odometer to add to the graph. // By default the scale will be 0 to 100 $odo = new Odometer(); $odo->SetColor('white'); // Set display value for the odometer $odo->needle->Set(70); // Add drop shadow for needle $odo->needle->SetShadow(); // Add the odometer to the graph $graph->Add($odo); // ... and finally stroke and stream the image back to the browser $graph->Stroke();
<?php require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_odo.php'; // Create a new odometer graph (width=250, height=200 pixels) $graph = new OdoGraph(250, 150); $graph->title->Set('Example with scale indicators'); // Add drop shadow for graph $graph->SetShadow(); // Now we need to create an odometer to add to the graph. // By default the scale will be 0 to 100 $odo = new Odometer(ODO_HALF); // Add color indications $odo->AddIndication(0, 20, "green:0.7"); $odo->AddIndication(20, 30, "green:0.9"); $odo->AddIndication(30, 60, "yellow"); $odo->AddIndication(60, 80, "orange"); $odo->AddIndication(80, 100, "red"); $odo->SetCenterAreaWidth(0.45); // Set display value for the odometer $odo->needle->Set(90); // Add scale labels $odo->label->Set("mBar"); $odo->label->SetFont(FF_FONT2, FS_BOLD); // Add drop shadow for needle $odo->needle->SetShadow(); // Add the odometer to the graph $graph->Add($odo); // ... and finally stroke and stream the image back to the browser $graph->Stroke();
<?php require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_odo.php'; // Create a new odometer graph (width=250, height=200 pixels) $graph = new OdoGraph(600, 300); $odo = array(); $astyles = array(NEEDLE_ARROW_SS, NEEDLE_ARROW_SM, NEEDLE_ARROW_SL, NEEDLE_ARROW_MS, NEEDLE_ARROW_MM, NEEDLE_ARROW_ML, NEEDLE_ARROW_LS, NEEDLE_ARROW_LM, NEEDLE_ARROW_LL); $acaptions = array('SS', 'SM', 'SL', 'MS', 'MM', 'ML', 'LS', 'LM', 'LL'); for ($i = 0; $i < 9; ++$i) { $odo[$i] = new Odometer(); $odo[$i]->SetColor("lightyellow"); $odo[$i]->needle->Set(75); $odo[$i]->needle->SetStyle(NEEDLE_STYLE_ENDARROW, $astyles[$i]); $odo[$i]->caption->SetFont(FF_FONT1); $odo[$i]->caption->Set($acaptions[$i]); $odo[$i]->SetMargin(15); } $row1 = new LayoutHor(array($odo[0], $odo[1], $odo[2])); $row2 = new LayoutHor(array($odo[3], $odo[4], $odo[5])); $row3 = new LayoutHor(array($odo[6], $odo[7], $odo[8])); $col1 = new LayoutVert(array($row1, $row2, $row3)); // Add the odometer to the graph $graph->Add($col1); // ... and finally stroke and stream the image back to the browser $graph->Stroke();
<?php require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_odo.php'; require_once 'jpgraph/jpgraph_iconplot.php'; // Create a new odometer graph $graph = new OdoGraph(500, 180); $odo = array(); // Now we need to create an odometer to add to the graph. for ($i = 0; $i < 5; ++$i) { $odo[$i] = new Odometer(); $odo[$i]->SetColor('lightgray:1.9'); $odo[$i]->needle->Set(10 + $i * 17); $odo[$i]->needle->SetShadow(); if ($i < 2) { $fsize = 10; } else { $fsize = 8; } $odo[$i]->scale->label->SetFont(FF_ARIAL, FS_NORMAL, $fsize); $odo[$i]->AddIndication(92, 100, 'red'); $odo[$i]->AddIndication(80, 92, 'orange'); $odo[$i]->AddIndication(60, 80, 'yellow'); } // Create the layout $row1 = new LayoutHor(array($odo[0], $odo[1])); $row2 = new LayoutHor(array($odo[2], $odo[3], $odo[4])); $col1 = new LayoutVert(array($row1, $row2)); // Add the odometer to the graph $graph->Add($col1); // Add an icon and text
// Description: Example 0 for odometer graphs // Created: 2002-02-22 // Version: $Id: odoex00.php,v 1.1 2013/11/29 14:07:31 napalm Exp $ // // Comment: // Example file for odometer graph. This examples demonstrates the simplest // possible graph using all default values for colors, sizes etc. // // Copyright (C) 2002 Johan Persson. All rights reserved. //============================================================================= require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_odo.php'; //--------------------------------------------------------------------- // Create a new odometer graph (width=250, height=200 pixels) //--------------------------------------------------------------------- $graph = new OdoGraph(250, 130); $graph->SetColor('white'); $graph->SetMarginColor('white'); $graph->SetFrame(false); //--------------------------------------------------------------------- // Now we need to create an odometer to add to the graph. // By default the scale will be 0 to 100 //--------------------------------------------------------------------- $odo = new Odometer(); //--------------------------------------------------------------------- // Set display value for the odometer //--------------------------------------------------------------------- $odo->needle->Set(40); //--------------------------------------------------------------------- // Add the odometer to the graph //---------------------------------------------------------------------
// Version: $Id: odoex08.php,v 1.1 2013/11/29 14:07:27 napalm Exp $ // // Comment: // Example file for odometer graph. This examples extends odoex07 // by showing how 1) a drop shadow may be added to the frame // 2) Change the margin color 3) Change the fill color of the odometer // 4) adding a drop shadow to the indicator needles // // Copyright (C) 2002 Johan Persson. All rights reserved. //============================================================================= require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_odo.php'; //--------------------------------------------------------------------- // Create a new odometer graph (width=250, height=200 pixels) //--------------------------------------------------------------------- $graph = new OdoGraph(250, 250); //--------------------------------------------------------------------- // Add a drop shadow to the fram //--------------------------------------------------------------------- $graph->SetShadow(); //--------------------------------------------------------------------- // Change the color of the odometer plotcanvas. NOT the odometer // fill color itself. //--------------------------------------------------------------------- $graph->SetColor("lightyellow"); //--------------------------------------------------------------------- // Change the color of the margin in the graph //--------------------------------------------------------------------- $graph->SetMarginColor("khaki:0.6"); //--------------------------------------------------------------------- // Specify title and subtitle using default fonts
<?php require_once 'jpgraph/jpgraph.php'; require_once 'jpgraph/jpgraph_odo.php'; // Create a new odometer graph (width=250, height=200 pixels) $graph = new OdoGraph(250, 200); // Setup titles $graph->title->Set("Result for 2002"); $graph->title->SetColor("white"); $graph->title->SetFont(FF_ARIAL, FS_BOLD, 14); $graph->subtitle->Set("New York Office"); $graph->subtitle->SetColor("white"); $graph->caption->Set("Figure 1.This is a very, very\nlong text with multiples lines\nthat are added as a caption."); $graph->caption->SetColor("white"); // Setup colors // Make the border 40% darker than normal "khaki" $graph->SetMarginColor("khaki:0.6"); $graph->SetColor("khaki"); // Now we need to create an odometer to add to the graph. // By default the scale will be 0 to 100 $odo = new Odometer(); // Setup colors for odometyer plot $odo->SetColor('white'); $odo->scale->label->SetColor("darkred"); $odo->needle->SetFillColor("yellow"); // Set display value for the odometer $odo->needle->Set(30); // Add the odometer to the graph $graph->Add($odo); // ... and finally stroke and stream the image back to the client $graph->Stroke();