SciChart Android 3D Charts API > 3D Chart Types > The Waterfall 3D Chart Type
The Waterfall 3D Chart Type

The Waterfall 3D Chart renders a two-dimensional array as a series of slices. The WaterfallRenderableSeries3D type provides a number of configurable chart types in SciChart 3D, including:

  • Dynamic updating slices for visualizing spectra (Acoustic or radio frequency domain data)
  • Volumetric slices
  • Optional PointMarkers at data-points.

 

Declaring a Waterfall 3D Chart

To declare a Waterfall 3D Chart with SciChart, use the following code:

Waterfall 3D
Copy Code
final Camera3D camera = sciChart3DBuilder.newCamera3D().build();
final NumericAxis3D xAxis = sciChart3DBuilder.newNumericAxis3D().build();
final NumericAxis3D yAxis = sciChart3DBuilder.newNumericAxis3D().build();
final NumericAxis3D zAxis = sciChart3DBuilder.newNumericAxis3D().withAutoRangeMode(AutoRange.Always).build();
final WaterfallDataSeries3D<Double, Double, Double> ds = new WaterfallDataSeries3D<>(Double.class, Double.class, Double.class, POINTS_PER_SLICE, SLICE_COUNT);
ds.setStartX(10d);
ds.setStepX(1d);
ds.setStartZ(1d);
for (int sliceIndex = 0; sliceIndex < SLICE_COUNT; sliceIndex++) {
    for (int pointIndex = 0; pointIndex < POINTS_PER_SLICE; pointIndex++) {
        ds.updateYAt(pointIndex, sliceIndex, yValue);
    }
}
final int[] fillColors = new int[] {Red, Orange, Yellow, GreenYellow, DarkGreen};
final float[] fillStops = new float[] {0, .25f, .5f, .75f, 1};
final GradientColorPalette gradientFillColorPalette = new GradientColorPalette(fillColors, fillStops);
final WaterfallRenderableSeries3D rs = sciChart3DBuilder.newWaterfallSeries3D()
        .withDataSeries(ds)
        .withStroke(Transparent)
        .withStrokeThicknes(1f)
        .withSliceThickness(0f)
        .withYColorMapping(gradientFillColorPalette)
        .build();
UpdateSuspender.using(surface3d, new Runnable() {
    @Override
    public void run() {
        surface3d.setCamera(camera);
        surface3d.setXAxis(xAxis);
        surface3d.setYAxis(yAxis);
        surface3d.setZAxis(zAxis);
        surface3d.getRenderableSeries().add(rs);
        surface3d.getChartModifiers().add(sciChart3DBuilder.newModifierGroupWithDefaultModifiers().build());
    }
});

Data is stored in the WaterfallDataSeries3D Type. This represents a 2-dimensional grid, typically of type Double (but can be defined with generics).

 

Some important points to note: