polarvector.php
Back to Chart Graphics
addTitle("Polar Vector Chart Demonstration", "Arial Bold Italic", 15);
# Set center of plot area at (230, 240) with radius 180 pixels
$c->setPlotArea(230, 240, 180);
# Set the grid style to circular grid
$c->setGridStyle(false);
# Set angular axis as 0 - 360, with a spoke every 30 units
$c->angularAxis->setLinearScale(0, 360, 30);
# Add a polar vector layer to the chart with blue (0000ff) vectors
$c->addVectorLayer($radius, $angle, $magnitude, $direction, RadialAxisScale, 0x0000ff);
# Output the chart
$viewer = new WebChartViewer("chart1");
$viewer->setChart($c, SVG);
# Include tool tip for the chart
$viewer->setImageMap($c->getHTMLImageMap("", "",
"title='Vector at ({value}, {angle} deg): Length = {len}, Angle = {dir} deg'"));
?>
Polar Vector Chart
Polar Vector Chart
renderHTML(); ?>