Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
 
3
include ("../jpgraph.php");
4
include ("../jpgraph_bar.php");
5
 
6
$data1y=array(-8,8,9,3,5,6);
7
$data2y=array(18,2,1,7,5,4);
8
 
9
// Create the graph. These two calls are always required
10
$graph = new Graph(500,400,"auto");
11
$graph->SetScale("textlin");
12
 
13
$graph->SetShadow();
14
$graph->img->SetMargin(40,30,20,40);
15
 
16
// Create the bar plots
17
$b1plot = new BarPlot($data1y);
18
$b1plot->SetFillColor("orange");
19
$b1plot->value->Show();
20
$b2plot = new BarPlot($data2y);
21
$b2plot->SetFillColor("blue");
22
$b2plot->value->Show();
23
 
24
// Create the grouped bar plot
25
$gbplot = new AccBarPlot(array($b1plot,$b2plot));
26
 
27
// ...and add it to the graPH
28
$graph->Add($gbplot);
29
 
30
$graph->title->Set("Accumulated bar plots");
31
$graph->xaxis->title->Set("X-title");
32
$graph->yaxis->title->Set("Y-title");
33
 
34
$graph->title->SetFont(FF_FONT1,FS_BOLD);
35
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
36
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
37
 
38
// Display the graph
39
$graph->Stroke();
40
?>