Line | |
---|
1 | <?php |
---|
2 | require_once ('jpgraph/jpgraph.php'); |
---|
3 | require_once ('jpgraph/jpgraph_windrose.php'); |
---|
4 | |
---|
5 | // Some data for the five windrose plots |
---|
6 | $data = array( |
---|
7 | array( |
---|
8 | 1 => array(10,10,13,7), |
---|
9 | 2 => array(2,8,10), |
---|
10 | 4 => array(1,12,22)), |
---|
11 | array( |
---|
12 | 4 => array(12,8,2,3), |
---|
13 | 2 => array(5,4,4,5,2)), |
---|
14 | array( |
---|
15 | 1 => array(12,8,2,3), |
---|
16 | 3 => array(5,4,4,5,2)), |
---|
17 | array( |
---|
18 | 2 => array(12,8,2,3), |
---|
19 | 3 => array(5,4,4,5,2)), |
---|
20 | ); |
---|
21 | |
---|
22 | // Create a windrose graph with titles |
---|
23 | $graph = new WindroseGraph(600,650); |
---|
24 | $graph->SetShadow(); |
---|
25 | |
---|
26 | $graph->title->Set('Multiple plots with automatic layout'); |
---|
27 | $graph->title->SetFont(FF_ARIAL,FS_BOLD,14); |
---|
28 | |
---|
29 | // Setup the individual windrose plots |
---|
30 | $wp = array(); |
---|
31 | for( $i=0; $i < 4; ++$i ) { |
---|
32 | $wp[$i] = new WindrosePlot($data[$i]); |
---|
33 | $wp[$i]->SetSize(0.22); |
---|
34 | $wp[$i]->SetCenterSize(0.25); |
---|
35 | } |
---|
36 | |
---|
37 | // Position with two rows. Two plots in top row and three plots in |
---|
38 | // bottom row. |
---|
39 | $hl1 = new LayoutHor( array( $wp[0], $wp[1] ) ); |
---|
40 | $hl2 = new LayoutHor( array( $wp[2], $wp[3] ) ); |
---|
41 | $vl = new LayoutVert( array( $hl1, $hl2) ); |
---|
42 | |
---|
43 | $graph->Add($vl); |
---|
44 | $graph->Stroke(); |
---|
45 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.