| 1 | <?php
|
|---|
| 2 | require_once ('jpgraph/jpgraph.php');
|
|---|
| 3 | require_once ('jpgraph/jpgraph_windrose.php');
|
|---|
| 4 | require_once ('jpgraph/jpgraph_flags.php');
|
|---|
| 5 |
|
|---|
| 6 | // Data can be specified using both ordinal idex of axis as well
|
|---|
| 7 | // as the direction label
|
|---|
| 8 | $data2 = array(
|
|---|
| 9 | 'vsv' => array(12,8,2,3),
|
|---|
| 10 | 6 => array(5,4,4,5,4),
|
|---|
| 11 | );
|
|---|
| 12 |
|
|---|
| 13 | $se_CompassLbl = array('O','ONO','NO','NNO','N','NNV','NV','VNV','V','VSV','SV','SSV','S','SSO','SO','OSO');
|
|---|
| 14 |
|
|---|
| 15 | // Create a new small windrose graph
|
|---|
| 16 | $graph = new WindroseGraph(400,400);
|
|---|
| 17 | $graph->SetMargin(25,25,25,25);
|
|---|
| 18 | $graph->SetFrame();
|
|---|
| 19 |
|
|---|
| 20 | $graph->title->Set('Example with background flag');
|
|---|
| 21 | #$graph->title->SetFont(FF_VERA,FS_BOLD,14);
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 | //$graph->SetBackgroundImage('bkgimg.jpg',BGIMG_FILLFRAME);
|
|---|
| 25 | //$graph->SetBackgroundImageMix(90);
|
|---|
| 26 | $graph->SetBackgroundCFlag(28,BGIMG_FILLFRAME,15);
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | $wp2 = new WindrosePlot($data2);
|
|---|
| 30 | $wp2->SetType(WINDROSE_TYPE16);
|
|---|
| 31 | $wp2->SetSize(0.55);
|
|---|
| 32 | $wp2->SetPos(0.5,0.5);
|
|---|
| 33 | $wp2->SetAntiAlias(false);
|
|---|
| 34 |
|
|---|
| 35 | $wp2->SetFont(FF_ARIAL,FS_BOLD,10);
|
|---|
| 36 | $wp2->SetFontColor('black');
|
|---|
| 37 |
|
|---|
| 38 | $wp2->SetCompassLabels($se_CompassLbl);
|
|---|
| 39 | $wp2->legend->SetMargin(20,5);
|
|---|
| 40 |
|
|---|
| 41 | $wp2->scale->SetZFont(FF_ARIAL,FS_NORMAL,8);
|
|---|
| 42 | $wp2->scale->SetFont(FF_ARIAL,FS_NORMAL,9);
|
|---|
| 43 | $wp2->scale->SetLabelFillColor('white','white');
|
|---|
| 44 |
|
|---|
| 45 | $wp2->SetRangeColors(array('green','yellow','red','brown'));
|
|---|
| 46 |
|
|---|
| 47 | $graph->Add($wp2);
|
|---|
| 48 | $graph->Stroke();
|
|---|
| 49 | ?>
|
|---|
| 50 |
|
|---|