threedscatteraxis.php
Back to Chart Graphics
addTitle("3D Scatter Chart Axis Types", "Arial", 18);
# Set the center of the plot region at (385, 270), and set width x depth x height to 480 x 240 x 240
# pixels
$c->setPlotRegion(385, 270, 480, 240, 240);
# Set the elevation and rotation angles to 30 and -10 degrees
$c->setViewAngle(30, -10);
# Add a legend box at (380, 40) with horizontal layout. Use 9pt Arial Bold font.
$b = $c->addLegend(380, 40, false, "Arial Bold", 9);
$b->setAlignment(TopCenter);
$b->setRoundedCorners();
# Add a scatter group to the chart using 13 pixels red (ff0000) glass sphere symbols, with dotted
# drop lines
$g0 = $c->addScatterGroup($dataX, $dataY0, $dataZ0, "Alpha Series", GlassSphere2Shape, 13, 0xff0000)
;
$g0->setDropLine($c->dashLineColor(SameAsMainColor, DotLine));
# Add a scatter group to the chart using 13 pixels blue (00cc00) cross symbols, with dotted drop
# lines
$g1 = $c->addScatterGroup($dataX, $dataY1, $dataZ1, "Beta Series", Cross2Shape(), 13, 0x00cc00);
$g1->setDropLine($c->dashLineColor(SameAsMainColor, DotLine));
# Set x-axis tick density to 50 pixels. ChartDirector auto-scaling will use this as the guideline
# when putting ticks on the x-axis.
$c->xAxis->setTickDensity(50);
# Set the y-axis labels
$c->yAxis->setLabels($labelsY);
# Set label style to Arial bold for all axes
$c->xAxis->setLabelStyle("Arial Bold");
$c->yAxis->setLabelStyle("Arial Bold");
$c->zAxis->setLabelStyle("Arial Bold");
# Set the x, y and z axis titles using deep blue (000088) 15 points Arial font
$c->xAxis->setTitle("Date/Time Axis", "Arial Italic", 15, 0x000088);
$c->yAxis->setTitle("Label\nBased\nAxis", "Arial Italic", 15, 0x000088);
$c->zAxis->setTitle("Numeric Axis", "Arial Italic", 15, 0x000088);
# Output the chart
$viewer = new WebChartViewer("chart1");
$viewer->setChart($c, SVG);
?>
3D Scatter Axis Types
3D Scatter Axis Types
renderHTML(); ?>