1 | <?php
|
---|
2 | require_once("include_path_inc.php");
|
---|
3 | require_once("jpgraph.php");
|
---|
4 | require_once("jpgraph_line.php");
|
---|
5 | require_once("jpgraph_scatter.php");
|
---|
6 |
|
---|
7 | $datay1=array(20,15,23,15);
|
---|
8 | $datay2=array(12,9,42,8);
|
---|
9 | $datay3=array(5,17,32,24);
|
---|
10 |
|
---|
11 | //Setupthegraph
|
---|
12 | $graph=new Graph(300,250);
|
---|
13 |
|
---|
14 | $graph->SetScale("textlin");
|
---|
15 |
|
---|
16 | // $theme_class=new UniversalTheme;
|
---|
17 |
|
---|
18 | // $graph->SetTheme($theme_class);
|
---|
19 |
|
---|
20 | $graph->img->SetAntiAliasing(false);
|
---|
21 |
|
---|
22 | $graph->title->Set('FilledY-grid');
|
---|
23 |
|
---|
24 | $graph->SetBox(false);
|
---|
25 |
|
---|
26 | $graph->img->SetAntiAliasing();
|
---|
27 |
|
---|
28 | $graph->yaxis->HideZeroLabel();
|
---|
29 |
|
---|
30 | $graph->yaxis->HideLine(false);
|
---|
31 |
|
---|
32 | $graph->yaxis->HideTicks(false,false);
|
---|
33 |
|
---|
34 | $graph->xgrid->Show();
|
---|
35 |
|
---|
36 | $graph->xgrid->SetLineStyle("solid");
|
---|
37 |
|
---|
38 | $graph->xaxis->SetTickLabels(array('A','B','C','D'));
|
---|
39 |
|
---|
40 | $graph->xgrid->SetColor('#E3E3E3');
|
---|
41 |
|
---|
42 | //Createthefirstline
|
---|
43 | $p1=new LinePlot($datay1);
|
---|
44 | $graph->AddLine($p1);
|
---|
45 | //$p1->SetColor("#6495ED");
|
---|
46 | $p1->SetColor('red');
|
---|
47 | $p1->SetLegend('Line1');
|
---|
48 |
|
---|
49 | // //Createthesecondline
|
---|
50 | $p2=new LinePlot($datay2);
|
---|
51 | $graph->Add($p2);
|
---|
52 | //$p2->SetColor("#B22222");
|
---|
53 | $p2->SetColor('green');
|
---|
54 | $p2->SetLegend('Line2');
|
---|
55 |
|
---|
56 | // //Createthethirdline
|
---|
57 |
|
---|
58 | // $p3=new LinePlot($datay3);
|
---|
59 |
|
---|
60 | // $graph->Add($p3);
|
---|
61 |
|
---|
62 | // $p3->SetColor("#FF1493");
|
---|
63 |
|
---|
64 | // $p3->SetLegend('Line3');
|
---|
65 |
|
---|
66 | // // $graph->legend->SetFrameWeight(1);
|
---|
67 |
|
---|
68 | //Outputline
|
---|
69 |
|
---|
70 | $graph->Stroke();
|
---|
71 |
|
---|
72 | ?>
|
---|