4.2.5 Surface3D Series

Surface3D Series renders a three dimensional surface that connects a set of data points. This Series uses ChartDataModel. There are 3 strategies available in MCharts for Surface3D Series:

4.2.5.1 Surface3D Series

This Series renders data model in accordance to height value and which contains no null points.

Surface3D Series Demonstration

Figure 4.2.5.1.1 Surface3D Series Demonstration

View Source

4.2.5.2 Surface3D Series with holes

This Series whit null values leaves empty holes in Surface3D charts.

Surface3D with Holes Demostration

Figure 4.2.5.2.1 Surface3D Series With the Holes Demonstration

View Source

4.2.5.3 Surface3D Series with filled holes

This Series fill holes (null values) in Surface3D charts.The hole fill color can be specified.

1
2
3
4
// The Surface strategy is specified
series3D.setStrategy (Surface3DStrategies.SURFACE_WITH_FILLED_HOLES);
// The holes (null value) colors are specified  
series3D.getPaintStyle ().setBackground (SurfacePaintTags.NULL, Color.BLACK);

Other Surface3D Series Properties

Solid Wall

For Surface3D series possible set solid wall and specify the wall color.

 
series3D.setSolid (true);
series3D.getPaintStyle ().setBackground (SurfacePaintTags.SOLID, Color.LIGHT_GRAY);
Wireframe

For this series, there is a possibility to set wireframe, using setWireFrame(boolean) method.

 
series3D.setWireFrame (true);
Markers

It is possible to set markers which represent specific points in the chart.

1
2
3
4
5
6
7
8
9
10
11
12
13
ChartDataModel  markerData = new ChartDataModel();
 
DataColumnType [] columnTypes = new DataColumnType []
{
  DataColumnType.KEY,
  DataColumnType.VALUE,
  DataColumnType.EXTENT
};
 
markerData.add (columnTypes, new Object [] {new Double(0.4), new Double(1)});
markerData.add (columnTypes, new Object [] {new Double(0.3), new Double(0.5)});
 
series3D.setMarkers(new DotMarker3D(),markerData);
Smooth shading

It is possible to set smooth shading for Surface 3D (continues, gradient coloring). By Default shading mode for Surface 3D is DISCRETE.

 
 // Set shading mode Smooth
    series3D.setShadingMode(SurfaceShadingMode.SMOOTH);

Surface3D Series in Smooth Mode Demonstration

Figure 4.2.5.2.2 Surface3D Series in Smooth Mode Demonstration