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_line.php");
4
 
5
$ydata = array(11,3,8,12,5,1,9,13,5,7);
6
$ydata2 = array(1,19,15,7,22,14,5,9,21,13);
7
 
8
$gJpgBrandTiming=true;
9
 
10
// Create the graph. These two calls are always required
11
$graph = new Graph(300,200,"auto");
12
$graph->SetScale("textlin");
13
 
14
// Create the linear plot
15
$lineplot=new LinePlot($ydata);
16
 
17
$lineplot2=new LinePlot($ydata2);
18
 
19
// Add the plot to the graph
20
$graph->Add($lineplot);
21
$graph->Add($lineplot2);
22
 
23
$graph->img->SetMargin(40,20,20,40);
24
$graph->title->Set("Timing a graph");
25
$graph->xaxis->title->Set("X-title");
26
$graph->yaxis->title->Set("Y-title");
27
 
28
$graph->title->SetFont(FF_FONT1,FS_BOLD);
29
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
30
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
31
 
32
$lineplot->SetColor("blue");
33
$lineplot->SetWeight(2);
34
 
35
$lineplot2->SetColor("orange");
36
$lineplot2->SetWeight(2);
37
 
38
$graph->yaxis->SetColor("red");
39
$graph->yaxis->SetWeight(2);
40
$graph->SetShadow();
41
 
42
// Display the graph
43
$graph->Stroke();
44
?>