1 | <?php // content="text/plain; charset=utf-8" |
---|
2 | require_once ('jpgraph/jpgraph.php'); |
---|
3 | require_once ('jpgraph/jpgraph_line.php'); |
---|
4 | |
---|
5 | $datay = array(20,10,35,5,17,35,22); |
---|
6 | |
---|
7 | // Setup the graph |
---|
8 | $graph = new Graph(400,250); |
---|
9 | $graph->SetScale("intlin",0,$aYMax=50); |
---|
10 | $theme_class=new UniversalTheme; |
---|
11 | $graph->SetTheme($theme_class); |
---|
12 | |
---|
13 | $graph->SetBox(false); |
---|
14 | |
---|
15 | $graph->title->Set('Step Line'); |
---|
16 | $graph->ygrid->Show(true); |
---|
17 | $graph->xgrid->Show(false); |
---|
18 | $graph->yaxis->HideZeroLabel(); |
---|
19 | $graph->ygrid->SetFill(true,'#FFFFFF@0.5','#FFFFFF@0.5'); |
---|
20 | $graph->SetBackgroundGradient('blue', '#55eeff', GRAD_HOR, BGRAD_PLOT); |
---|
21 | $graph->xaxis->SetTickLabels(array('A','B','C','D','E','F','G')); |
---|
22 | |
---|
23 | // Create the line |
---|
24 | $p1 = new LinePlot($datay); |
---|
25 | $graph->Add($p1); |
---|
26 | |
---|
27 | $p1->SetFillGradient('yellow','red'); |
---|
28 | $p1->SetStepStyle(); |
---|
29 | $p1->SetColor('#808000'); |
---|
30 | |
---|
31 | // Output line |
---|
32 | $graph->Stroke(); |
---|
33 | |
---|
34 | ?> |
---|
35 | |
---|
36 | |
---|