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

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 1.1 KB
Line 
1<?php // content="text/plain; charset=utf-8"
2// Illustration of the different patterns for bands
3// $Id: smallstaticbandsex5.php,v 1.1 2002/09/01 21:51:08 aditus Exp $
4require_once ('jpgraph/jpgraph.php');
5require_once ('jpgraph/jpgraph_bar.php');
6
7$datay=array(10,29,3,6);
8
9// Create the graph.
10$graph = new Graph(200,150);   
11$graph->SetScale("textlin");
12$graph->SetMargin(25,10,20,20);
13
14// Add 10% grace ("space") at top and botton of Y-scale.
15$graph->yscale->SetGrace(10);
16
17// Create a bar pot
18$bplot = new BarPlot($datay);
19$bplot->SetFillColor("lightblue");
20
21// Position the X-axis at the bottom of the plotare
22$graph->xaxis->SetPos("min");
23
24$graph->ygrid->Show(false);
25
26// .. and add the plot to the graph
27$graph->Add($bplot);
28
29// Add band
30$band = new PlotBand(HORIZONTAL,BAND_HVCROSS,15,35,'khaki4');
31$band->ShowFrame(true);
32$band->SetOrder(DEPTH_FRONT);
33$graph->Add($band);
34
35// Set title
36$graph->title->SetFont(FF_ARIAL,FS_BOLD,10);
37$graph->title->SetColor('darkred');
38$graph->title->Set('BAND_HVCROSS, In front');
39
40
41$graph->Stroke();
42?>
Note: See TracBrowser for help on using the repository browser.