| 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 |
|
|
|
7 |
// Create the graph. These two calls are always required
|
|
|
8 |
$graph = new Graph(350,250,"auto");
|
|
|
9 |
$graph->SetScale("textlin");
|
|
|
10 |
$graph->img->SetMargin(30,90,40,50);
|
|
|
11 |
$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
|
|
|
12 |
$graph->title->Set("Dashed lineplot");
|
|
|
13 |
|
|
|
14 |
// Create the linear plot
|
|
|
15 |
$lineplot=new LinePlot($ydata);
|
|
|
16 |
$lineplot->SetLegend("Test 1");
|
|
|
17 |
$lineplot->SetColor("blue");
|
|
|
18 |
|
|
|
19 |
// Style can also be specified as SetStyle([1|2|3|4]) or
|
|
|
20 |
// SetStyle("solid"|"dotted"|"dashed"|"lobgdashed")
|
|
|
21 |
$lineplot->SetStyle("dashed");
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
// Add the plot to the graph
|
|
|
25 |
$graph->Add($lineplot);
|
|
|
26 |
|
|
|
27 |
// Display the graph
|
|
|
28 |
$graph->Stroke();
|
|
|
29 |
?>
|