Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

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