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