Line | |
---|
1 | <?php // content="text/plain; charset=utf-8" |
---|
2 | require_once ('jpgraph/jpgraph.php'); |
---|
3 | require_once ('jpgraph/jpgraph_line.php'); |
---|
4 | |
---|
5 | // Some (random) data |
---|
6 | $ydata = array(11,3,8,12,5,1,9,13,5,7); |
---|
7 | |
---|
8 | // Size of the overall graph |
---|
9 | $width=350; |
---|
10 | $height=250; |
---|
11 | |
---|
12 | // Create the graph and set a scale. |
---|
13 | // These two calls are always required |
---|
14 | $graph = new Graph($width,$height); |
---|
15 | $graph->SetScale('intlin'); |
---|
16 | |
---|
17 | // Create the linear plot |
---|
18 | $lineplot=new LinePlot($ydata); |
---|
19 | |
---|
20 | // Add the plot to the graph |
---|
21 | $graph->Add($lineplot); |
---|
22 | |
---|
23 | // Display the graph |
---|
24 | $graph->Stroke(); |
---|
25 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.