contourinterpolate.php
Back to Chart Graphics
setPlotArea(30, 25, 300, 300, -1, -1, -1, 0xc0000000, -1);
# Add a contour layer using the given data
$layer = $c->addContourLayer($dataX, $dataY, $dataZ);
# Set the x-axis and y-axis scale
$c->xAxis->setLinearScale(-4, 4, 1);
$c->yAxis->setLinearScale(-4, 4, 1);
if ($chartIndex == 0) {
# Discrete coloring, spline surface interpolation
$c->addTitle("Spline Surface - Discrete Coloring", "Arial Bold Italic", 12);
} else if ($chartIndex == 1) {
# Discrete coloring, linear surface interpolation
$c->addTitle("Linear Surface - Discrete Coloring", "Arial Bold Italic", 12);
$layer->setSmoothInterpolation(false);
} else if ($chartIndex == 2) {
# Smooth coloring, spline surface interpolation
$c->addTitle("Spline Surface - Continuous Coloring", "Arial Bold Italic", 12);
$layer->setContourColor(Transparent);
$layer->colorAxis->setColorGradient(true);
} else {
# Discrete coloring, linear surface interpolation
$c->addTitle("Linear Surface - Continuous Coloring", "Arial Bold Italic", 12);
$layer->setSmoothInterpolation(false);
$layer->setContourColor(Transparent);
$layer->colorAxis->setColorGradient(true);
}
# Output the chart
$viewer->setChart($c, SVG);
}
# This example includes 4 charts
$viewers = array();
for ($i = 0; $i < 4; ++$i) {
$viewers[$i] = new WebChartViewer("chart$i");
createChart($viewers[$i], $i);
}
?>
Contour Interpolation
Contour Interpolation
renderHTML(), " ";
}
?>