[42] | 1 | <?php // content="text/plain; charset=utf-8" |
---|
| 2 | require_once ('jpgraph/jpgraph.php'); |
---|
| 3 | require_once ('jpgraph/jpgraph_line.php'); |
---|
| 4 | |
---|
| 5 | $labels = array("Oct 2000","Nov 2000","Dec 2000","Jan 2001","Feb 2001","Mar 2001","Apr 2001","May 2001"); |
---|
| 6 | $datay = array(1.23,1.9,1.6,3.1,3.4,2.8,2.1,1.9); |
---|
| 7 | $graph = new Graph(300,250); |
---|
| 8 | $graph->img->SetMargin(40,40,40,80); |
---|
| 9 | $graph->img->SetAntiAliasing(); |
---|
| 10 | $graph->SetScale("textlin"); |
---|
| 11 | $graph->SetShadow(); |
---|
| 12 | $graph->title->Set("Example slanted X-labels"); |
---|
| 13 | $graph->title->SetFont(FF_VERDANA,FS_NORMAL,14); |
---|
| 14 | |
---|
| 15 | $graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,11); |
---|
| 16 | $graph->xaxis->SetTickLabels($labels); |
---|
| 17 | $graph->xaxis->SetLabelAngle(45); |
---|
| 18 | |
---|
| 19 | $p1 = new LinePlot($datay); |
---|
| 20 | $p1->mark->SetType(MARK_FILLEDCIRCLE); |
---|
| 21 | $p1->mark->SetFillColor("red"); |
---|
| 22 | $p1->mark->SetWidth(4); |
---|
| 23 | $p1->SetColor("blue"); |
---|
| 24 | $p1->SetCenter(); |
---|
| 25 | $graph->Add($p1); |
---|
| 26 | |
---|
| 27 | $graph->Stroke(); |
---|
| 28 | |
---|
| 29 | ?> |
---|
| 30 | |
---|
| 31 | |
---|