1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
| <?php
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_windrose.php');
$data[0] = array(
0 => array(1,1,2.5,4),
1 => array(3,4,1,4),
3 => array(2,7,4,4,3),
5 => array(2,7,1,2));
$data[1] = array(
"n" => array(1,1,2.5,4),
"ssw" => array(3,4,1,4),
"se" => array(2,7,4,4,3));
$layout = array(
array(WINDROSE_TYPE8,0.25,0.55,0.4,0.25),
array(WINDROSE_TYPE16,0.75,0.55,0.4,0.25));
$legendtxt = array('(m/s) Station 7','(m/s) Station 12');
$graph = new WindroseGraph(600,350);
$graph->SetShadow('darkgray');
$graph->title->Set('Windrose example 3');
$graph->title->SetFont(FF_VERDANA,FS_BOLD,12);
$graph->title->SetColor('navy');
$graph->subtitle->Set('(Multiple plots in the same graph)');
$graph->subtitle->SetFont(FF_VERDANA,FS_NORMAL,9);
$graph->subtitle->SetColor('navy');
for( $i=0; $i < count($data); ++$i ) {
$wp[$i] = new WindrosePlot($data[$i]);
$wp[$i]->SetType($layout[$i][0]);
$wp[$i]->scale->SetFont(FF_TIMES,FS_NORMAL,10);
$wp[$i]->scale->SetFontColor('navy');
$wp[$i]->SetPos($layout[$i][1],$layout[$i][2]);
$wp[$i]->SetSize($layout[$i][3]);
$wp[$i]->SetZCircleSize($layout[$i][4]);
$wp[$i]->SetFont(FF_ARIAL,FS_NORMAL,10);
$wp[$i]->SetFontColor('darkgreen');
$wp[$i]->legend->SetText($legendtxt[$i]);
$graph->Add($wp[$i]);
}
$graph->Stroke();
?> |