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

Last change on this file was 42, checked in by marrucho, 10 years ago
File size: 1.0 KB
Line 
1<?php // content="text/plain; charset=utf-8"
2require_once ('jpgraph/jpgraph.php');
3require_once ('jpgraph/jpgraph_line.php');
4require_once ('jpgraph/jpgraph_error.php');
5
6$errdatay = array(11,9,2,4,19,26,13,19,7,12);
7
8// Create the graph. These two calls are always required
9$graph = new Graph(300,200);   
10$graph->SetScale("textlin");
11
12$graph->img->SetMargin(40,30,20,40);
13$graph->SetShadow();
14
15// Create the linear plot
16$errplot=new ErrorLinePlot($errdatay);
17$errplot->SetColor("red");
18$errplot->SetWeight(2);
19$errplot->SetCenter();
20$errplot->line->SetWeight(2);
21$errplot->line->SetColor("blue");
22
23// Add the plot to the graph
24$graph->Add($errplot);
25
26$graph->title->Set("Linear error plot");
27$graph->xaxis->title->Set("X-title");
28$graph->yaxis->title->Set("Y-title");
29
30$graph->title->SetFont(FF_FONT1,FS_BOLD);
31$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
32$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
33
34$datax = $gDateLocale->GetShortMonth();
35$graph->xaxis->SetTickLabels($datax);
36
37
38// Display the graph
39$graph->Stroke();
40?>
Note: See TracBrowser for help on using the repository browser.