source: trunk/xgraph/phpgraph1.php @ 42

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 1.3 KB
Line 
1<?php
2require_once("include_path_inc.php");
3require_once("jpgraph.php");
4require_once("jpgraph_line.php");
5require_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
44$p1=new LinePlot($datay1);
45
46$graph->AddLine($p1);
47
48$p1->SetColor("#6495ED");
49
50// //Createthesecondline
51
52// $p2=new LinePlot($datay2);
53
54// $graph->Add($p2);
55
56// $p2->SetColor("#B22222");
57
58// $p2->SetLegend('Line2');
59
60// //Createthethirdline
61
62// $p3=new LinePlot($datay3);
63
64// $graph->Add($p3);
65
66// $p3->SetColor("#FF1493");
67
68// $p3->SetLegend('Line3');
69
70// // $graph->legend->SetFrameWeight(1);
71
72//Outputline
73
74$graph->Stroke();
75
76?>
Note: See TracBrowser for help on using the repository browser.