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 idex of axis as well
|
---|
6 | // as the direction label
|
---|
7 | $data = array(
|
---|
8 | 1 => array(10,10,13,7),
|
---|
9 | 2 => array(2,8,10),
|
---|
10 | 4 => array(1,12,22),
|
---|
11 | );
|
---|
12 |
|
---|
13 | $data2 = array(
|
---|
14 | 4 => array(12,8,2,3),
|
---|
15 | 2 => array(5,4,4,5,2),
|
---|
16 | );
|
---|
17 |
|
---|
18 | // Create a new small windrose graph
|
---|
19 | $graph = new WindroseGraph(660,400);
|
---|
20 | $graph->SetShadow();
|
---|
21 |
|
---|
22 | $graph->title->Set('Two windrose plots in one graph');
|
---|
23 | $graph->title->SetFont(FF_ARIAL,FS_BOLD,14);
|
---|
24 | $graph->subtitle->Set('(Using Box() for each plot)');
|
---|
25 |
|
---|
26 | $wp = new WindrosePlot($data);
|
---|
27 | $wp->SetType(WINDROSE_TYPE8);
|
---|
28 | $wp->SetSize(0.42);
|
---|
29 | $wp->SetPos(0.25,0.55);
|
---|
30 | $wp->SetBox();
|
---|
31 |
|
---|
32 | $wp2 = new WindrosePlot($data2);
|
---|
33 | $wp2->SetType(WINDROSE_TYPE16);
|
---|
34 | $wp2->SetSize(0.42);
|
---|
35 | $wp2->SetPos(0.74,0.55);
|
---|
36 | $wp2->SetBox();
|
---|
37 | $wp2->SetRangeColors(array('green','yellow','red','brown'));
|
---|
38 |
|
---|
39 | $graph->Add($wp);
|
---|
40 | $graph->Add($wp2);
|
---|
41 |
|
---|
42 | $graph->Stroke();
|
---|
43 | ?>
|
---|
44 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.