Search Results for

    Show / Hide Table of Contents

    The Waterfall 3D Chart Type

    The Waterfall Chart renders a two-dimensional array as a series of slices. In SciChart it's defined by the WaterfallRenderableSeries3D class and provides a number of configurable chart types in SciChart 3D. As an example, it can be used for the following:

    • dynamic updating slices for visualizing spectra (Acoustic or radio frequency domain data)
    • volumetric slices
    • optional PointMarkers at data-points.
    • and more...

    Waterfall 3D Series Type

    Note

    Examples of the Waterfall 3D Series can be found in the SciChart Android Examples Suite as well as on GitHub:

    • Native Example
    • Xamarin Example

    In the Surface Mesh 3D Series, the data is stored in the WaterfallDataSeries3D<TX,TY,TZ>. This represents a 2-dimensional grid, typically of type double.

    Some important points which is must to know while configuring the Waterfall Series:

    • The double values which are stored in the WaterfallDataSeries3D<TX,TY,TZ> correspond to the heights on the chart [Y-Axis]. They are transformed into chart World Coordinates via the yAxis.
    • The Z and X Data-Value are defined by the startX, stepX, startZ and stepZ properties on UniformGridDataSeries3D<TX,TY,TZ>. These are transformed into World Coordinates via the xAxis and zAxis respectively.
    • The Color of each slice and outlines are define by the MeshColorPalette via the following properties:
      • selectedColorMapping
      • yColorMapping
      • zColorMapping
      • yStrokeColorMapping
      • zStrokeColorMapping

    Read on to learn more about Applying Palettes to the Waterfall

    Create a Surface Mesh Series 3D

    In order to create Waterfall Series - you will need to provide the WaterfallDataSeries3D<TX,TY,TZ> with N x M array of points, which is an array of slices.

    See the code below, which shows how to create the above chart:

    • Java
    • Java with Builders API
    • Kotlin
    final GradientColorPalette fillColorPalette = new GradientColorPalette(new int[]{0xFFFF0000, 0xFFFFA500, 0xFFFFFF00, 0xFFADFF2F, 0xFF006400}, new float[]{0.0f, 0.25f, 0.5f, 0.75f, 1.0f});
    final GradientColorPalette strokeColorPalette = new GradientColorPalette(new int[]{0xFFDC143C, 0xFFFF8C00, 0xFF32CD32, 0xFF32CD32}, new float[]{0.0f, 0.33f, 0.67f, 1.0f});
    
    final WaterfallDataSeries3D<Double, Double, Double> ds = new WaterfallDataSeries3D<>(Double.class, Double.class, Double.class, POINTS_PER_SLICE, SLICE_COUNT);
    ds.setStartX(10.0);
    ds.setStartZ(1.0);
    
    fillDataSeries(ds);
    
    final WaterfallRenderableSeries3D rSeries = new WaterfallRenderableSeries3D();
    rSeries.setDataSeries(ds);
    rSeries.setStroke(0xFF0000FF);
    rSeries.setStrokeThickness(convertValueToDp(1.0f));
    rSeries.setSliceThickness(0.0f);
    rSeries.setYColorMapping(fillColorPalette);
    rSeries.setYStrokeColorMapping(strokeColorPalette);
    rSeries.setOpacity(0.8f);
    
    final GradientColorPalette fillColorPalette = new GradientColorPalette(new int[]{0xFFFF0000, 0xFFFFA500, 0xFFFFFF00, 0xFFADFF2F, 0xFF006400}, new float[]{0.0f, 0.25f, 0.5f, 0.75f, 1.0f});
    final GradientColorPalette strokeColorPalette = new GradientColorPalette(new int[]{0xFFDC143C, 0xFFFF8C00, 0xFF32CD32, 0xFF32CD32}, new float[]{0.0f, 0.33f, 0.67f, 1.0f});
    
    final WaterfallDataSeries3D<Double, Double, Double> ds = new WaterfallDataSeries3D<>(Double.class, Double.class, Double.class, POINTS_PER_SLICE, SLICE_COUNT);
    ds.setStartX(10.0);
    ds.setStartZ(1.0);
    
    fillDataSeries(ds);
    
    WaterfallRenderableSeries3D rSeries = sciChart3DBuilder.newWaterfallSeries3D()
            .withDataSeries(ds)
            .withStroke(0xFF0000FF)
            .withStrokeThicknes(1.0f)
            .withSliceThickness(0.0f)
            .withYColorMapping(fillColorPalette)
            .withYStrokeColorMapping(strokeColorPalette)
            .withOpacity(0.8f)
            .build();
    
    val fillColorPalette = GradientColorPalette(
        intArrayOf(0xFFFF0000.toInt(), 0xFFFFA500.toInt(), 0xFFFFFF00.toInt(), 0xFFADFF2F.toInt(), 0xFF006400.toInt()),
        floatArrayOf(0.0f, 0.25f, 0.5f, 0.75f, 1.0f)
    )
    val strokeColorPalette = GradientColorPalette(
        intArrayOf(0xFFDC143C.toInt(), 0xFFFF8C00.toInt(), 0xFF32CD32.toInt(), 0xFF32CD32.toInt()),
        floatArrayOf(0.0f, 0.33f, 0.67f, 1.0f)
    )
    val ds = WaterfallDataSeries3D(
        Double::class.java,
        Double::class.java,
        Double::class.java, POINTS_PER_SLICE, SLICE_COUNT
    )
    ds.setStartX(10.0)
    ds.setStartZ(1.0)
    
    fillDataSeries(ds)
    
    val rSeries = WaterfallRenderableSeries3D()
    rSeries.dataSeries = ds
    rSeries.stroke = -0xffff01
    rSeries.strokeThickness = convertValueToDp(1.0f)
    rSeries.sliceThickness = 0.0f
    rSeries.yColorMapping = fillColorPalette
    rSeries.yStrokeColorMapping = strokeColorPalette
    rSeries.opacity = 0.8f
    

    Applying Palettes to the Waterfall

    The Waterfall chart obeys Palette rules similar to that of the 3D SurfaceMesh Chart. To learn more about the types of palette available and how to declare them - please see the Applying Palettes section of the 3D SurfaceMesh Chart article.

    Palettes which may be applied to the WaterfallRenderableSeries3D chart include:

    • SolidColorBrushPalette - applies a solid color the waterfall slice or stroke.
    • GradientColorPalette - maps a linear gradient to the slice or stroke, where heights map to successive colors.

    The properties which allow colouring the Waterfall slices and outlines are available for the Z-Direction and Y-Direction. Those are mutually exclusive, and you should choose one direction at a time.

    Read on to see some examples of applying Palettes to WaterfallRenderableSeries3D.

    Applying Solid Palettes to Waterfall Slices

    To apply Solid color to the Waterfall Slices, please use the following code:

    • Java
    • Java with Builders API
    • Kotlin
    rSeries.setYColorMapping(new SolidColorBrushPalette(0xFF6495ED));
    rSeries.setYStrokeColorMapping(new SolidColorBrushPalette(0xFF6495ED));
    
    rSeries = sciChart3DBuilder.newWaterfallSeries3D()
            .withYColorMapping(new SolidColorBrushPalette(0xFF6495ED))
            .withYStrokeColorMapping(new SolidColorBrushPalette(0xFF6495ED))
            .build();
    
    rSeries.yColorMapping = SolidColorBrushPalette(0xFF6495ED.toInt())
    rSeries.yStrokeColorMapping = SolidColorBrushPalette(0xFF6495ED.toInt())
    
    Solid Fill Solid Outline
    Waterfall Solid Fill Waterfall Solid Outline
    Applying Linear Gradient Palettes to Waterfall Slice Fill

    To apply Linear Gradient to the Waterfall Slices, first prepare the GradientColorPalette for the upcoming steps:

    • Java
    • Java with Builders API
    • Kotlin
    final int[] colors = new int[]{0xFFFF0000, 0xFFFFA500, 0xFFFFFF00, 0xFFADFF2F, 0xFF006400};
    final float[] stops = new float[]{0, .25f, .5f, .75f, 0};
    final GradientColorPalette colorPalette = new GradientColorPalette(colors, stops);
    
    final int[] colors = new int[]{0xFFFF0000, 0xFFFFA500, 0xFFFFFF00, 0xFFADFF2F, 0xFF006400};
    final float[] stops = new float[]{0, .25f, .5f, .75f, 0};
    final GradientColorPalette colorPalette = new GradientColorPalette(colors, stops);
    
    val colors = intArrayOf(0xFFFF0000.toInt(), 0xFFFFA500.toInt(), 0xFFFFFF00.toInt(), 0xFFADFF2F.toInt(), 0xFF006400.toInt())
    val stops = floatArrayOf(0f, .25f, .5f, .75f, 0f)
    val colorPalette = GradientColorPalette(colors, stops)
    

    From here, we can apply it to the Slice Fill, Outline or Both.

    Applying a Color Palette onto Slice Fill in a Y or Z direction:

    • Java
    • Java with Builders API
    • Kotlin
    // Z-Direction
    rSeries.setZColorMapping(colorPalette);
    rSeries.setZStrokeColorMapping(new SolidColorBrushPalette(0x00FFFFFF));
    
    // or Y-Direction
    rSeries.setYColorMapping(colorPalette);
    rSeries.setYStrokeColorMapping(new SolidColorBrushPalette(0x00FFFFFF));
    
    // Z-Direction
    rSeries = sciChart3DBuilder.newWaterfallSeries3D()
            .withZColorMapping(colorPalette)
            .withZStrokeColorMapping(new SolidColorBrushPalette(0x00FFFFFF))
            .build();
    
    // or Y-Direction
    rSeries = sciChart3DBuilder.newWaterfallSeries3D()
            .withYColorMapping(colorPalette)
            .withYStrokeColorMapping(new SolidColorBrushPalette(0x00FFFFFF))
            .build();
    
    // Z-Direction
    rSeries.zColorMapping = colorPalette
    rSeries.zStrokeColorMapping = SolidColorBrushPalette(0x00FFFFFF)
    
    // or Y-Direction
    rSeries.yColorMapping = colorPalette
    rSeries.yStrokeColorMapping = SolidColorBrushPalette(0x00FFFFFF)
    
    Z-Direction Fill Y-Direction Fill
    Waterfall Gradient Fill Z Direction Waterfall Gradient Fill Y Direction

    Applying a Color Palette onto Slice Stroke in a Y or Z direction:

    • Java
    • Java with Builders API
    • Kotlin
    // Z-Direction
    rSeries.setZColorMapping(new SolidColorBrushPalette(0x00FFFFFF));
    rSeries.setZStrokeColorMapping(colorPalette);
    
    // or Y-Direction
    rSeries.setYColorMapping(new SolidColorBrushPalette(0x00FFFFFF));
    rSeries.setYStrokeColorMapping(colorPalette);
    
    // Z-Direction
    rSeries = sciChart3DBuilder.newWaterfallSeries3D()
            .withZColorMapping(new SolidColorBrushPalette(0x00FFFFFF))
            .withZStrokeColorMapping(colorPalette)
            .build();
    
    // or Y-Direction
    rSeries = sciChart3DBuilder.newWaterfallSeries3D()
            .withYColorMapping(new SolidColorBrushPalette(0x00FFFFFF))
            .withYStrokeColorMapping(colorPalette)
            .build();
    
    // Z-Direction
    rSeries.zColorMapping = SolidColorBrushPalette(0x00FFFFFF)
    rSeries.zStrokeColorMapping = colorPalette
    
    // or Y-Direction
    rSeries.yColorMapping = SolidColorBrushPalette(0x00FFFFFF)
    rSeries.yStrokeColorMapping = colorPalette
    
    Z-Direction Stroke Y-Direction Stroke
    Waterfall Gradient Stroke Z Direction Waterfall Gradient Stroke Y Direction

    Volumetric Waterfall 3D

    A Waterfall Chart can be made volumetric by setting the property sliceThickness (default value = 0), e.g.:

    • Java
    • Java with Builders API
    • Kotlin
    final WaterfallRenderableSeries3D rSeries = new WaterfallRenderableSeries3D();
    rSeries.setSliceThickness(10.0f);
    
    final WaterfallRenderableSeries3D rSeries = sciChart3DBuilder.newWaterfallSeries3D()
            .withSliceThickness(10.0f)
            .build();
    
    val rSeries = WaterfallRenderableSeries3D()
    rSeries.sliceThickness = 10.0f
    

    Volumetric Waterfall 3D

    PointMarkers on Waterfall 3D

    A Waterfall Chart Slice data-points can be marked with a Point Markers. That's achieved by providing the Point Marker 3D for the WaterfallRenderableSeries3D. See the code snipped below:

    • Java
    • Java with Builders API
    • Kotlin
    final SpherePointMarker3D pointMarker = new SpherePointMarker3D();
    pointMarker.setFill(0xFFFFA500);
    pointMarker.setSize(convertValueToDp(10.0f));
    
    final WaterfallRenderableSeries3D rSeries = new WaterfallRenderableSeries3D();
    rSeries.setPointMarker(pointMarker);
    
    final SpherePointMarker3D pointMarker = sciChart3DBuilder.newSpherePointMarker3D()
            .withFill(0xFFFFA500)
            .withSize(10.0f)
            .build();
    
    final WaterfallRenderableSeries3D rSeries = sciChart3DBuilder.newWaterfallSeries3D()
            .withPointMarker(pointMarker)
            .build();
    
    val pointMarker = SpherePointMarker3D()
    pointMarker.fill = 0xFFFFA500.toInt()
    pointMarker.size = convertValueToDp(10.0f)
    
    val rSeries = WaterfallRenderableSeries3D()
    rSeries.pointMarker = pointMarker
    

    Waterfall 3D With PointMarkers

    Note

    For more information - please refer to the PointMarker API article.

    Real-time Waterfall 3D Example

    In SciChart, it's possible to create real-time Waterfall 3D Charts which is shown below:

    Note

    Examples of the Real-Time Waterfall 3D Series can be found in the SciChart Android Examples Suite as well as on GitHub:

    • Native Example
    • Xamarin Example
    Back to top © 2011-2025 SciChart. All rights reserved. | sitemap.xml