addTitle(" Contour Chart with Scattered Data", "Arial Italic", 15);
# Set the plotarea at (65, 40) and of size 360 x 360 pixels. Use semi-transparent black (c0000000)
# for both horizontal and vertical grid lines
$c->setPlotArea(65, 40, 360, 360, -1, -1, -1, 0xc0000000, -1);
# Set x-axis and y-axis title using 12 points Arial Bold Italic font
$c->xAxis->setTitle("X-Axis Title Place Holder", "Arial Bold Italic", 10);
$c->yAxis->setTitle("Y-Axis Title Place Holder", "Arial Bold Italic", 10);
# Set x-axis and y-axis labels to use Arial Bold font
$c->xAxis->setLabelStyle("Arial Bold");
$c->yAxis->setLabelStyle("Arial Bold");
# When x-axis and y-axis color to transparent
$c->xAxis->setColors(Transparent);
$c->yAxis->setColors(Transparent);
# Add a scatter layer to the chart to show the position of the data points. Disable the image map
# for the scatter layer. We will use the contour layer to provide the tooltip.
$c->addScatterLayer($dataX, $dataY, "", Cross2Shape(0.2), 7, 0x000000)->setHTMLImageMap("{disable}")
;
# Add a contour layer using the given data
$layer = $c->addContourLayer($dataX, $dataY, $dataZ);
# Move the grid lines in front of the contour layer
$c->getPlotArea()->moveGridBefore($layer);
# Add a color axis (the legend) in which the top center is anchored at (245, 455). Set the length to
# 330 pixels and the labels on the top side.
$cAxis = $layer->setColorAxis(245, 455, TopCenter, 330, Top);
# Add a bounding box to the color axis using the default line color as border.
$cAxis->setBoundingBox(Transparent, LineColor);
# Add a title to the color axis using 12 points Arial Bold Italic font
$cAxis->setTitle("Color Legend Title Place Holder", "Arial Bold Italic", 10);
# Set color axis labels to use Arial Bold font
$cAxis->setLabelStyle("Arial Bold");
# Set the color axis range as 0 to 20, with a step every 2 units
$cAxis->setLinearScale(0, 20, 2);
# Output the chart
$viewer = new WebChartViewer("chart1");
$viewer->setChart($c, SVG);
# Include CDML tool tip for the chart.
$viewer->setImageMap($c->getHTMLImageMap("", "",
"title='<*cdml*><*b*>X: {x|2}<*br*>Y: {y|2}<*br*>Z: {z|2}'"));
# Output Javascript chart model to support contour chart tooltips
$viewer->setChartModel($c->getJsChartModel())
?>
Scattered Data Contour Chart
Scattered Data Contour Chart
renderHTML(); ?>