addTitle("Wind Direction", "arialbi.ttf", 15, 0xffffff); $textBoxObj->setBackground(0x000080); $legendBox = $c->addLegend(230, 35, false, "arialbd.ttf", 9); $legendBox->setAlignment(TopCenter); $legendBox->setBackground(Transparent, Transparent, 1); $legendBox->addKey("5 m/s or above", 0xff3333); $legendBox->addKey("1 - 5 m/s", 0x33ff33); $legendBox->addKey("less than 1 m/s", 0x3333ff); # Set plot area center at (230, 280) with radius 180 pixels and white background $c->setPlotArea(230, 280, 180, 0xffffff); # Set the grid style to circular grid $c->setGridStyle(false); # Set angular axis as 0 - 360, with a spoke every 30 units $angularAxisObj = $c->angularAxis(); $angularAxisObj->setLinearScale2(0, 360, $labels); for($i = 0; $i < count($angles); ++$i) { $angularAxisObj = $c->angularAxis(); $angularAxisObj->addZone($angles[$i] - 10, $angles[$i] + 10, 0, $data0[$i], 0x3333ff, 0); $angularAxisObj = $c->angularAxis(); $angularAxisObj->addZone($angles[$i] - 10, $angles[$i] + 10, $data0[$i], $data1[ $i], 0x33ff33, 0); $angularAxisObj = $c->angularAxis(); $angularAxisObj->addZone($angles[$i] - 10, $angles[$i] + 10, $data1[$i], $data2[ $i], 0xff3333, 0); } # Add an Transparent invisible layer to ensure the axis is auto-scaled using the data $c->addLineLayer($data2, Transparent); # output the chart header("Content-type: image/png"); print($c->makeChart2(PNG)); ?>