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
// Some data
6
$months=$gDateLocale->GetShortMonth();
7
 
8
srand ((double) microtime() * 1000000);
9
for( $i=0; $i<25; ++$i) {
10
	$databary[]=rand(1,50);
11
	$databarx[]=$months[$i%12];
12
}
13
 
14
// New graph with a drop shadow
15
$graph = new Graph(300,200,'auto');
16
$graph->SetShadow();
17
 
18
// Use a "text" X-scale
19
$graph->SetScale("textlin");
20
 
21
// Specify X-labels
22
$graph->xaxis->SetTickLabels($databarx);
23
 
24
// Set title and subtitle
25
$graph->title->Set("Bar tutorial example 3");
26
 
27
// Use built in font
28
$graph->title->SetFont(FF_FONT1,FS_BOLD);
29
 
30
// Create the bar plot
31
$b1 = new BarPlot($databary);
32
$b1->SetLegend("Temperature");
33
//$b1->SetAbsWidth(6);
34
//$b1->SetShadow();
35
 
36
// The order the plots are added determines who's ontop
37
$graph->Add($b1);
38
 
39
// Finally output the  image
40
$graph->Stroke();
41
 
42
?>
43
 
44