The Ellipsoid 3D Chart Type
In SciChart, Ellipsoid 3D Charts are provided by the combination of the Free Surface 3D Series and EllipsoidDataSeries3D<TXYZ> underlying DataSeries.
The location of the EllipsoidDataSeries3D<TXYZ> is defined by following properties:
- offsetX – a location of the Ellipsoid by the
X-Axis
; - offsetY – a location of the Ellipsoid by the
Y-Axis
; - offsetZ – a location of the Ellipsoid by the
Z-Axis
;
The size of the EllipsoidDataSeries3D<TXYZ> is defined by following properties:
- a – a radius of the Ellipsoid along the
X-Axis
; - b – a radius of the Ellipsoid along the
Y-Axis
; - c – a radius of the Ellipsoid along the
Z-Axis
;
Note
Examples for the Ellipsoid Series 3D can be found in the SciChart Android Examples Suite as well as on GitHub:
Create a Ellipsoid 3D Chart
To create a Ellipsoid 3D Chart, use the following code:
final int sizeU = 40, sizeV = 20;
final EllipsoidDataSeries3D<Double> meshDataSeries = new EllipsoidDataSeries3D<>(Double.class, sizeU, sizeV);
meshDataSeries.setA(6d);
meshDataSeries.setB(6d);
meshDataSeries.setC(6d);
final Random random = new Random();
for (int u = 0; u < sizeU; u++) {
for (int v = 0; v < sizeV; v++) {
final double weight = 1d - Math.abs(2d * v / sizeV - 1d);
final double offset = random.nextDouble();
meshDataSeries.setDisplacement(u, v, offset * weight);
}
}
final int[] colors = new int[]{0xFF00008B, 0xFF0000FF, 0xFF00FFFF, 0xFFADFF2F, 0xFFFFFF00, 0xFFFF0000, 0xFF8B0000};
final float[] stops = new float[]{0, .1f, .3f, .5f, .7f, .9f, 1};
final GradientColorPalette palette = new GradientColorPalette(colors, stops);
final FreeSurfaceRenderableSeries3D rs = new FreeSurfaceRenderableSeries3D();
rs.setDataSeries(meshDataSeries);
rs.setDrawMeshAs(DrawMeshAs.SolidWireframe);
rs.setStroke(0x77228B22);
rs.setContourInterval(0.1f);
rs.setContourStroke(0x77228B22);
rs.setStrokeThickness(convertValueToDp(2f));
rs.setLightingFactor(0.8f);
rs.setMeshColorPalette(palette);
rs.setPaletteMinMaxMode(FreeSurfacePaletteMinMaxMode.Relative);
rs.setPaletteMinimum(new Vector3(0f, 6f, 0f));
rs.setPaletteMaximum(new Vector3(0f, 7f, 0f));
Note
See other constrained and unconstrained Free Surface Series types in the corresponding articles.