source: trunk/xgraph/jpgraph/Examples/clipping_ex1.php @ 42

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 962 bytes
Line 
1<?php // content="text/plain; charset=utf-8"
2require_once ('jpgraph/jpgraph.php');
3require_once ('jpgraph/jpgraph_line.php');
4
5$ydata = array(11,3,8,12,5,1,9,13,5,7);
6
7// Create the graph. These two calls are always required
8$graph = new Graph(300,250);   
9$graph->SetScale('intlin',0,10);
10$graph->SetMargin(30,20,70,40);
11$graph->SetMarginColor(array(177,191,174));
12
13$graph->SetClipping(false);
14
15$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);
16
17$graph->ygrid->SetLineStyle('dashed');
18
19$graph->title->Set("Manual scale");
20$graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
21$graph->title->SetColor('white');
22$graph->subtitle->Set("(No clipping)");
23$graph->subtitle->SetColor('white');
24$graph->subtitle->SetFont(FF_ARIAL,FS_BOLD,10);
25
26// Create the linear plot
27$lineplot=new LinePlot($ydata);
28$lineplot->SetColor("red");
29$lineplot->SetWeight(2);
30
31// Add the plot to the graph
32$graph->Add($lineplot);
33
34// Display the graph
35$graph->Stroke();
36?>
Note: See TracBrowser for help on using the repository browser.