ChartDirector 6.0 (Ruby Edition)
SurfaceChart.setInterpolation
Usage
setInterpolation(xSamples [, ySamples [, isSmooth ]])
Description
Enables and sets the degree and method of interpolation of the data points.
A surface chart consists of planar patches, drawn using the data points as the vertices. To create visually smooth surfaces, we may use a large number of small planar patches. However, this requires a large number of data points.
For example, consider a plot region of which the x and y dimensions are both 400 pixels in length. To create a smooth surface, if gridded data are used, the distance between grid lines should be no more than a few pixels. Suppose a grid spacing of 8 pixels is used. The grid size will be 51 x 51, and 2601 data points will be needed.
If the number of available data points are too small to create a smooth surface, This method can be used to generate a denser grid of data points from the original data points using interpolation.
Two types of interpolation are supported. In spline surface interpolation, ChartDirector will compute a smooth surface that passes through the original data points, and sample the spline surface for the new data points. In bilinear/linear interpolation, ChartDirector will apply bilinear/linear interpolation to its vertices of the original patches to compute the new data points.
Arguments
Argument | Default | Description |
xSamples | (Mandatory) | The number of samples on the x-dimension to interpolate to. |
ySamples | -1 | The number of samples on the y-dimension to interpolate to. -1 means it is the same as xSamples. |
isSmooth | true | A true value means to use spline surface interpolation. A false value means to use bilinear/linear interpolation. |
Return Value
None
© 2017 Advanced Software Engineering Limited. All rights reserved.