예제 #1
0
// First create a new windrose graph with a title
$graph = new WindroseGraph(400, 450);
// Setup titles
$graph->title->Set('Windrose example 6');
$graph->title->SetFont(FF_VERDANA, FS_BOLD, 12);
$graph->title->SetColor('navy');
$graph->subtitle->Set('(Free type plot)');
$graph->subtitle->SetFont(FF_VERDANA, FS_ITALIC, 10);
$graph->subtitle->SetColor('navy');
// Create the windrose plot.
$wp = new WindrosePlot($data);
// Setup a free plot
$wp->SetType(WINDROSE_TYPEFREE);
// Setup labels
$wp->SetLabels($labels);
$wp->SetLabelPosition(LBLPOSITION_CENTER);
$wp->SetLabelMargin(30);
// Setup the colors for the ranges
$wp->SetRangeColors($rangeColors);
// Adjust the font and font color for scale labels
$wp->scale->SetFont(FF_ARIAL, FS_NORMAL, 9);
// Set the diameter and position for plot
$wp->SetSize(230);
$wp->SetZCircleSize(30);
// Adjust the font and font color for compass directions
$wp->SetFont(FF_ARIAL, FS_NORMAL, 10);
$wp->SetFontColor('darkgreen');
// Adjust grid colors
$wp->SetGridColor('darkgreen@0.7', 'blue');
// Add (m/s) text to legend
$wp->legend->SetText('(m/s)');