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