1 | <?php // content="text/plain; charset=utf-8" |
---|
2 | require_once ('jpgraph/jpgraph.php'); |
---|
3 | require_once ('jpgraph/jpgraph_line.php'); |
---|
4 | require_once ('jpgraph/jpgraph_scatter.php'); |
---|
5 | |
---|
6 | $datay1 = array(15,21,24,10,37,29,47); |
---|
7 | $datay2 = array(8,6,11,26,10,4,2); |
---|
8 | |
---|
9 | // Setup the graph |
---|
10 | $graph = new Graph(300,250); |
---|
11 | |
---|
12 | $graph->SetScale("textlin",0,50); |
---|
13 | |
---|
14 | //$theme_class=new DefaultTheme; |
---|
15 | //$graph->SetTheme($theme_class); |
---|
16 | |
---|
17 | $graph->title->Set("Filled Area"); |
---|
18 | |
---|
19 | $graph->SetBox(false); |
---|
20 | $graph->yaxis->HideLine(false); |
---|
21 | $graph->yaxis->HideTicks(false,false); |
---|
22 | $graph->yaxis->HideZeroLabel(); |
---|
23 | |
---|
24 | $graph->xaxis->SetTickLabels(array('A','B','C','D','E','F','G')); |
---|
25 | |
---|
26 | // Create the plot |
---|
27 | $p1 = new LinePlot($datay1); |
---|
28 | $graph->Add($p1); |
---|
29 | |
---|
30 | $p2 = new LinePlot($datay2); |
---|
31 | $graph->Add($p2); |
---|
32 | |
---|
33 | // Use an image of favourite car as marker |
---|
34 | $p1->mark->SetType(MARK_IMG,'rose.gif',1.0); |
---|
35 | $p1->SetLegend('rose'); |
---|
36 | $p1->SetColor('#CD5C5C'); |
---|
37 | |
---|
38 | $p2->mark->SetType(MARK_IMG,'sunflower.gif',1.0); |
---|
39 | $p2->SetLegend('sunflower'); |
---|
40 | $p2->SetColor('#CD5C5C'); |
---|
41 | |
---|
42 | $graph->Stroke(); |
---|
43 | |
---|
44 | ?> |
---|
45 | |
---|
46 | |
---|