Line | |
---|
1 | <?php |
---|
2 | require_once ('jpgraph/jpgraph.php'); |
---|
3 | require_once ('jpgraph/jpgraph_windrose.php'); |
---|
4 | |
---|
5 | // Data can be specified using both ordinal index of the axis |
---|
6 | // as well as the direction label |
---|
7 | $data = array( |
---|
8 | 0 => array(1,1,2.5,4), |
---|
9 | 1 => array(3,4,1,4), |
---|
10 | 'wsw' => array(1,5,5,3), |
---|
11 | 'N' => array(2,7,5,4,2), |
---|
12 | 15 => array(2,7,12)); |
---|
13 | |
---|
14 | // First create a new windrose graph with a title |
---|
15 | $graph = new WindroseGraph(400,400); |
---|
16 | $graph->title->Set('Windrose example 1b'); |
---|
17 | $graph->title->SetFont(FF_VERDANA,FS_BOLD,12); |
---|
18 | $graph->title->SetColor('navy'); |
---|
19 | |
---|
20 | // Create the windrose plot. |
---|
21 | // The default plot will have 16 compass axis. |
---|
22 | $wp = new WindrosePlot($data); |
---|
23 | $wp->SetRadialGridStyle('solid'); |
---|
24 | $graph->Add($wp); |
---|
25 | |
---|
26 | // Setup the range so that the values do not touch eachother |
---|
27 | $wp->SetRanges(array(0,1,2,3,4,5,6,7,8,10)); |
---|
28 | $wp->SetRangeStyle(RANGE_DISCRETE); // Cmp with RANGE_OVERLAPPING as default |
---|
29 | |
---|
30 | // Send the graph to the browser |
---|
31 | $graph->Stroke(); |
---|
32 | ?> |
---|
33 | |
---|
Note: See
TracBrowser
for help on using the repository browser.