<?php
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_windrose.php');
$data = array(
0 => array(3,2,1,2,2),
4 => array(1,1,1.5,2),
6 => array(1,1,1.5,2),
12 => array(2,3,5,1),
);
$xpos1 = 0.26;
$xpos2 = 0.74;
$ypos1 = 0.5;
$ypos2 = 0.9;
$graph = new WindroseGraph(650,350);
$graph->title->Set('Interpretation of ordinal keys');
$graph->title->SetFont(FF_VERDANA,FS_BOLD,14);
$graph->title->SetColor('navy');
$wp1 = new WindrosePlot($data);
$wp1->SetType(WINDROSE_TYPE16);
$wp1->SetDataKeyEncoding(KEYENCODING_ANTICLOCKWISE);
$wp1->legend->Hide();
$wp1->SetPos($xpos1,$ypos1);
$wp1->SetSize(0.5);
$wp2 = new WindrosePlot($data);
$wp2->SetType(WINDROSE_TYPE16);
$wp2->SetDataKeyEncoding(KEYENCODING_CLOCKWISE);
$wp2->legend->Hide();
$wp2->SetPos($xpos2,$ypos1);
$wp2->SetSize(0.5);
$txt1 = new Text('KEYENCODING_ANTICLOCKWISE');
$txt1->SetFont(FF_COURIER,FS_BOLD,12);
$txt1->SetPos($xpos1,$ypos2);
$txt1->SetAlign('center','top');
$txt2 = new Text('KEYENCODING_CLOCKWISE');
$txt2->SetFont(FF_COURIER,FS_BOLD,12);
$txt2->SetPos($xpos2,$ypos2);
$txt2->SetAlign('center','top');
$graph->Add($wp1);
$graph->Add($txt1);
$graph->Add($wp2);
$graph->Add($txt2);
$graph->Stroke();
?> |