| Rev | Line | |
|---|
| [42] | 1 | <?php
|
|---|
| 2 | require_once ('jpgraph/jpgraph.php');
|
|---|
| 3 | require_once ('jpgraph/jpgraph_windrose.php');
|
|---|
| 4 | require_once ('jpgraph/jpgraph_iconplot.php');
|
|---|
| 5 |
|
|---|
| 6 | $data = array(
|
|---|
| 7 | 0 => array(1,1,2.5,4),
|
|---|
| 8 | 1 => array(3,4,1,4),
|
|---|
| 9 | 'wsw' => array(1,5,5,3),
|
|---|
| 10 | 'N' => array(2,7,5,4,2),
|
|---|
| 11 | 15 => array(2,7,12));
|
|---|
| 12 |
|
|---|
| 13 | // First create a new windrose graph with a title
|
|---|
| 14 | $graph = new WindroseGraph(400,400);
|
|---|
| 15 |
|
|---|
| 16 | // Creta an icon to be added to the graph
|
|---|
| 17 | $icon = new IconPlot('tornado.jpg',10,10,1.3,50);
|
|---|
| 18 | $icon->SetAnchor('left','top');
|
|---|
| 19 | $graph->Add($icon);
|
|---|
| 20 |
|
|---|
| 21 | // Setup title
|
|---|
| 22 | $graph->title->Set('Windrose icon example');
|
|---|
| 23 | $graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
|
|---|
| 24 | $graph->title->SetColor('navy');
|
|---|
| 25 |
|
|---|
| 26 | // Create the windrose plot.
|
|---|
| 27 | $wp = new WindrosePlot($data);
|
|---|
| 28 |
|
|---|
| 29 | // Add to graph and send back to client
|
|---|
| 30 | $graph->Add($wp);
|
|---|
| 31 | $graph->Stroke();
|
|---|
| 32 | ?>
|
|---|
| 33 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.