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_log.php");
4
include ("../jpgraph_line.php");
5
 
6
 
7
$ydata = array(11,3,8,42,5,1,9,13,5,7);
8
$datax = array("Jan","Feb","Mar","Apr","Maj","Jun","Jul","aug","Sep","Oct");
9
 
10
// Create the graph. These two calls are always required
11
$graph = new Graph(350,200,"auto");
12
$graph->SetScale("textlog");
13
 
14
$graph->img->SetMargin(40,110,20,40);
15
$graph->SetShadow();
16
 
17
$graph->ygrid->Show(true,true);
18
$graph->xgrid->Show(true,false);
19
 
20
// Specify the tick labels
21
$a = $gDateLocale->GetShortMonth();
22
$graph->xaxis->SetTickLabels($a);
23
 
24
// Create the linear plot
25
$lineplot=new LinePlot($ydata);
26
 
27
// Add the plot to the graph
28
$graph->Add($lineplot);
29
 
30
$graph->title->Set("Examples 9");
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
$lineplot->SetColor("blue");
39
$lineplot->SetWeight(2);
40
 
41
$graph->yaxis->SetColor("blue");
42
 
43
$lineplot->SetLegend("Plot 1");
44
 
45
$graph->legend->Pos(0.05,0.5,"right","center");
46
 
47
// Display the graph
48
$graph->Stroke();
49
?>