Platforms to show: All Mac Windows Linux Cross-Platform
Back to CDSurfaceChartMBS class.
CDSurfaceChartMBS.addSurfaceLine(x() as double, y() as double, colorValue as Integer, lineWidth as Integer = -1, side as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
x | (Mandatory) | An array of containing the x coordinates of the data points that define the line. |
y | (Mandatory) | An array of containing the y coordinates of the data points that define the line. |
color | (Mandatory) | The color of the line. |
lineWidth | 1 | The line width (thickness). |
side | 0 | A value of 1 means the line is drawn on the front side of the surface. A value of 0 means the line is drawn on the back side of the surface. The default value of 0 means the line is drawn on both sides of the surface. |
See also:
CDSurfaceChartMBS.addSurfaceLine(x1 as double, y1 as double, x2 as double, y2 as double, colorValue as Integer, lineWidth as Integer = -1, side as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
x1 | (Mandatory) | The x data coordinate of the first end-point of the line. |
y1 | (Mandatory) | The y data coordinate of the first end-point of the line. |
x2 | (Mandatory) | The x data coordinate of the second end-point of the line. |
y2 | (Mandatory) | The y data coordinate of the second end-point of the line. |
color | (Mandatory) | The color of the line. |
lineWidth | 1 | The line width (thickness). |
side | 0 | A value of 1 means the line is drawn on the front side of the surface. A value of 0 means the line is drawn on the back side of the surface. The default value of 0 means the line is drawn on both sides of the surface. |
See also:
CDSurfaceChartMBS.addSurfaceZone(x1 as double, y1 as double, x2 as double, y2 as double, fillColor as Integer, edgeColor as Integer = &hff000000, edgeWidth as Integer = 1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
x1 | (Mandatory) | The x data coordinate for the first corner of the rectangle. |
y1 | (Mandatory) | The y data coordinate for the first corner of the rectangle. |
x2 | (Mandatory) | The x data coordinate for the corner opposite to the first corner. |
y2 | (Mandatory) | The y data coordinate for the corner opposite to the first corner. |
fillColor | (Mandatory) | The fill color of the rectangle. |
edgeColor | Transparent | The border color of the rectangle. |
edgeWidth | 1 | The border width in pixels. |
CDSurfaceChartMBS.addXYProjection(offset as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The XY wall is the wall containing the x axis and y axis. It is usually under the plotted surface. Because of this, the surface may block the projection, making it hard to see. To address this issue, it is common to add a bottom margin to the z-axis (see Axis.setMargin). This will move the z-axis scale and therefore the surface upwards, leaving more space between the surface and the XY wall to make the projection more visible.
This method accepts an optional offset argument that can be used to move the projection vertically. A positive offset moves the it upwards. A negative offset moves it under the XY wall. Because of this, for negative offsets, the XY wall must be hidden using ThreeDChart.setWallVisibility, otherwise the chart will not be drawn correctly.
Argument | Default | Description |
offset | 0 | The vertical offset of the XY projection in 3D pixel coordinates. A positive offset moves it upwards. A negative offset moves it under the XY wall. |
Some examples using this method:
CDSurfaceChartMBS.Constructor(width as Integer = 640, height as Integer = 480, bgColor as Integer = &hffff0000, edgeColor as Integer = &hff000000, raisedEffect as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Arguments:
Argument | Default | Description |
width | (Mandatory) | The width of the chart in pixels. |
height | (Mandatory) | The height of the chart in pixels. |
bgColor | kBackgroundColor | The background color of the chart. |
edgeColor | kTransparent | The edge color of the chart. |
raisedEffect | 0 | The 3D border width. For positive values, the border will appear raised. For negative values, the border will appear depressed. A zero value means the border will appear flat. |
See also:
CDSurfaceChartMBS.Constructor(width as Integer, height as Integer, bgColor as color, edgeColor as color, raisedEffect as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDSurfaceChartMBS.getValuesAtPixel(x as Integer, y as Integer) as Double()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method is valid only after the chart image has been drawn (eg. using BaseChart.makeChart, BaseChart.makeChart2 or BaseChart.makeChart3). It is typically used to provide user feedback when the mouse moves on the chart.
If w values are not provided to the surface chart, the returned w value will be set to the same as the z value. If the pixel is not on the plotted surface, the returned array will be empty or null.
Argument | Default | Description |
x | (Mandatory) | The x pixel coordinate. |
y | (Mandatory) | The y pixel coordinate. |
Returns an array of 4 numbers representing the x, y, z and w values at the image pixel location. If the pixel is not on the plotted surface, the returned array will be empty or null.
CDSurfaceChartMBS.setBackSideBrightness(brightness as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The surface of a surface chart has two sides. The side that is facing the positive z direction of the plot region is the front side. The side that is facing the negative z direction of the plot region is the back side.
By default, the back side brightness is half the front side brightness. This method can be used to adjust the ratio.
Arguments:
Argument | Default | Description |
brightness | (Mandatory) | The ratio of the back side brightness to the front side brightness. |
CDSurfaceChartMBS.setBackSideColor(ColorValue as color)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDSurfaceChartMBS.setBackSideColor(ColorValue as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The surface of a surface chart has two sides. The side that is facing the positive z direction of the plot region is the front side. The side that is facing the negative z direction of the plot region is the back side.
By default, the back side is colored similar to the front side, but with different brightness of lighting parameters. This method can be used to color the back side with a fixed color instead.
Arguments:
Argument | Default | Description |
color | (Mandatory) | The color used for the back side. |
See also:
CDSurfaceChartMBS.setBackSideLighting(ambientLight as Double, diffuseLight as Double, specularLight as Double, shininess as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The surface of a surface chart has two sides. The side that is facing the positive z direction of the plot region is the front side. The side that is facing the negative z direction of the plot region is the back side.
ChartDirector uses the Phong lighting model to adjust the brightness of the surface to make it look realistic. The default lighting parameters for the back side is half the brightness of those for the front side. This method may be used to set alternative lighting parameters for the back side.
Arguments:
Argument | Default | Description |
ambientIntensity | (Mandatory) | The ambient reflection coefficient of the Phong lighting model. |
diffuseIntensity | (Mandatory) | The diffuse reflection coefficient of the Phong lighting model. |
specularIntensity | (Mandatory) | The specular reflection coefficient of the Phong lighting model. |
shininess | (Mandatory) | The shininess coefficient of the Phong lighting model. |
CDSurfaceChartMBS.setContourColor(contourColor as color, minorContourColor as color)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDSurfaceChartMBS.setContourColor(contourColor as Integer, minorContourColor as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The contour lines are lines that join regions of the same z value on the surface. The contour levels are determined by the ticks on the z-axis. Major ticks associate with major contour lines. Minor ticks associate with minor contour lines.
Arguments:
Argument | Default | Description |
contourColor | (Mandatory) | The color of the major contour lines. |
minorContourColor | -1 | The color of the minor contour lines. -1 means it is the same as the contourColor. |
See also:
CDSurfaceChartMBS.setData(xData() as Double, yData() as Double, zData() as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
ChartDirector supports both gridded and scattered data. If the data points are on a rectangular grid will no missing points, they will be handled as gridded data. Otherwise, they will be handled as scattered data.
For gridded data, you may provide the x and y values of the grid, and the z values of the data points. For a 10 x 15 grid, that means the x data series should have 10 values, the y data series should have 15 values, and the z data series should have 150 values. The x and y data series should be strictly monotonic (either strictly increasing or strictly decreasing).
For both gridded and scattered data, you may also provide the (x, y, z) values of the data points. For example, for 150 data points, the x, y and z data series should each have 150 values. ChartDirector will automatically detect if the data points are gridded or scattered.
Arguments:
Argument | Default | Description |
xData | (Mandatory) | An array of numbers representing the x data series. |
yData | (Mandatory) | An array of numbers representing the y data series. |
zData | (Mandatory) | An array of numbers representing the z data series. |
See also:
CDSurfaceChartMBS.setData(xData() as double, yData() as double, zData() as double, wData() as double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDSurfaceChartMBS.setInterpolation(xSamples as Integer, ySamples as Integer = -1, isSmooth as Boolean = true)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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. |
See also:
Some examples using this method:
- /ChartDirector/High Resolution Chart Examples/surface
- /ChartDirector/High Resolution Chart Examples/surface3
- /ChartDirector/High Resolution Chart Examples/surfaceaxis
- /ChartDirector/High Resolution Chart Examples/surfacewireframe
- /ChartDirector/surface2
- /ChartDirector/surface3
- /ChartDirector/surface3 red colors
- /ChartDirector/surfaceaxis
- /ChartDirector/surfaceaxis with controls
- /ChartDirector/surfacecolor
CDSurfaceChartMBS.setInterpolation(xSamples as Integer, ySamples as Integer, isSmooth as Boolean, isColorSmooth as Boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
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.
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 for the z values. A false value means to use bilinear/linear interpolation. |
isColorSmooth | (Optional) | A true value means to use spline surface interpolation for the w values. A false value means to use bilinear/linear interpolation. If this argument is not specified, the default is to use the same interpolation method as the z values. |
See also:
CDSurfaceChartMBS.setLighting(ambientIntensity as Double, diffuseIntensity as Double, specularIntensity as Double, shininess as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The surface of a surface chart has two sides. The side that is facing the positive z direction of the plot region is the front side. The side that is facing the negative z direction of the plot region is the back side.
ChartDirector uses the Phong lighting model to adjust the brightness of the surface to make it look realistic. The light source is assumed to be from the direction of the viewer and is far away. The default lighting parameters for the front side are 0.5 for both ambient and diffuse reflections, 1 for specular reflection and 8 for shininess.
Arguments:
Argument | Default | Description |
ambientIntensity | (Mandatory) | The ambient reflection coefficient of the Phong lighting model. |
diffuseIntensity | (Mandatory) | The diffuse reflection coefficient of the Phong lighting model. |
specularIntensity | (Mandatory) | The specular reflection coefficient of the Phong lighting model. |
shininess | (Mandatory) | The shininess coefficient of the Phong lighting model. |
CDSurfaceChartMBS.setShadingMode(shadingMode as Integer, wireWidth as Integer = 1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
ChartDirector supports the following methods for shading the surface.
Constant | Value | Description |
kSmoothShading | 0 | The brightness of the surface varies smoothly. |
kTriangularShading | 0 | The surface is divided into triangular patches. The brightness of the patches varies according to their orientation. Within a patch, the brightness is constant. |
kRectangularShading | 0 | The surface is divided into rectangular patches. The brightness of the patches varies according to their orientation. Within a patch, the brightness is constant. |
kTriangularFrame | 0 | The surface is divided into triangular patches. Only the edges of the patches are drawn. |
kRectangularFrame | 0 | The surface is divided into rectangular patches. Only the edges of the patches are drawn. |
Arguments:
Argument | Default | Description |
shadingMode | (Mandatory) | The shading mode, which must be one of the above constants. |
wireWidth | 1 | The wire width for use with wireframe shading modes. |
Some examples using this method:
CDSurfaceChartMBS.setSurfaceAxisGrid(majorXGridColor as color, majorYGridColor as color, minorXGridColor as color, minorYGridColor as color)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
Some examples using this method:
- /ChartDirector/High Resolution Chart Examples/surface3
- /ChartDirector/High Resolution Chart Examples/surfaceaxis
- /ChartDirector/scattersurface
- /ChartDirector/surface2
- /ChartDirector/surface3
- /ChartDirector/surface3 red colors
- /ChartDirector/surfaceaxis
- /ChartDirector/surfaceaxis with controls
- /ChartDirector/surfacelinezone
- /ChartDirector/surfaceprojection
CDSurfaceChartMBS.setSurfaceAxisGrid(majorXGridColor as Integer, majorYGridColor as Integer = -1, minorXGridColor as Integer = -1, minorYGridColor as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Axis grid lines are grid lines associated with the ticks on the x and y axes. Major grid lines associate with major ticks. Minor grid lines associate with minor ticks. They can be drawn on the surface of the surface chart, and on the plot region walls. This method is for the surface of the surface chart. For the plot region walls, see CDSurfaceChartMBS.setWallGrid.
Arguments:
Argument | Default | Description |
majorXGridColor | (Mandatory) | The color of the major x-axis grid lines on the surface. |
majorYGridColor | -1 | The color of the major y-axis grid lines on the surface. -1 means it is the same as the majorXGridColor. |
minorXGridColor | -1 | The color of the minor x-axis grid lines on the surface. -1 means it is the same as the majorXGridColor. |
minorYGridColor | -1 | The color of the minor y-axis grid lines on the surface. -1 means it is the same as the majorYGridColor. |
See also:
CDSurfaceChartMBS.setSurfaceDataGrid(xGridColor as color, yGridColor as color)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 11.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
CDSurfaceChartMBS.setSurfaceDataGrid(xGridColor as Integer, yGridColor as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 9.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Data grid lines are grid lines that define the positions of the data points. They can be drawn on the surface of the surface chart.
Arguments:
Argument | Default | Description |
xGridColor | (Mandatory) | The color of the x data grid lines. |
yGridColor | -1 | The color of the y data grid lines. -1 means it is the same as the yGridColor. |
See also:
CDSurfaceChartMBS.setSurfaceTexture(patternColor as color)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
A texture is a 2D image pattern for mapping onto a 3D surface. The pattern can be defined by using BaseChart.patternColor or BaseChart.patternColor2.
One common usage of this method is to apply an image the same size as the plot region xy plane to the surface. To do this, simply use an image with width and height equals to the plot region width and depth.
Argument | Default | Description |
patternColor | (Mandatory) | A color (normally a pattern color) that contains the texture image to be applied to the surface. |
See also:
Some examples using this method:
CDSurfaceChartMBS.setSurfaceTexture(patternColor as integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
A texture is a 2D image pattern for mapping onto a 3D surface. The pattern can be defined by using BaseChart.patternColor or BaseChart.patternColor2.
One common usage of this method is to apply an image the same size as the plot region xy plane to the surface. To do this, simply use an image with width and height equals to the plot region width and depth.
Argument | Default | Description |
patternColor | (Mandatory) | A color (normally a pattern color) that contains the texture image to be applied to the surface. |
See also:
CDSurfaceChartMBS.setWContourColor(wContourColor as color, wMinorContourColor as color)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The w contour lines are lines that join regions of the same w value on the surface. The contour levels are determined by the ticks on the color axis. Major ticks associate with major contour lines. Minor ticks associate with minor contour lines.
Argument | Default | Description |
wContourColor | (Mandatory) | The color of the major contour lines. |
wMinorContourColor | -1 | The color of the minor contour lines. -1 means it is the same as the contourColor. |
See also:
CDSurfaceChartMBS.setWContourColor(wContourColor as integer, wMinorContourColor as Integer = -1)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The w contour lines are lines that join regions of the same w value on the surface. The contour levels are determined by the ticks on the color axis. Major ticks associate with major contour lines. Minor ticks associate with minor contour lines.
Argument | Default | Description |
wContourColor | (Mandatory) | The color of the major contour lines. |
wMinorContourColor | -1 | The color of the minor contour lines. -1 means it is the same as the contourColor. |
See also:
The items on this page are in the following plugins: MBS ChartDirector Plugin.