gridstylesex1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php // content="text/plain; charset=utf-8"
include ('jpgraph/jpgraph.php');
include ('jpgraph/jpgraph_line.php');
 
$datay = array(7.5,9.2,6.3,5.8,2.9);
 
// Setup the graph
$graph = new Graph(500,300);
$graph->SetScale('linlin');
$graph->SetMarginColor('white');
$graph->title->Set('Grind line styles');
$graph->title->SetFont(FF_ARIAL,FS_BOLD,12);
 
$graph->xaxis->SetColor('darkgreen');
 
// Setup the Y-grid
$graph->ygrid->Show(true,true);
$graph->ygrid->SetColor('brown@0.7','gray');
$graph->ygrid->SetWeight(2,1);
$graph->ygrid->SetStyle('solid','dotted');
 
// Setup the X-grid
$graph->xgrid->Show(true,true);
$graph->xgrid->SetColor('darkgreen@0.8','gray');
$graph->xgrid->SetWeight(2,1);
$graph->xgrid->SetStyle('solid','dashed');
 
// Draw the grid on top to the line plot
$graph->SetGridDepth(DEPTH_FRONT);
 
// Create a simple line
$l1 = new LinePlot($datay);
$l1->SetColor('lightblue');
$l1->SetWeight(3);
$graph->Add($l1);
 
// Send back graph to client
$graph->Stroke();
 
?>