Search Results for

    Show / Hide Table of Contents

    The Scatter 3D Chart Type

    3D Scatter Charts can be created using the ScatterRenderableSeries3D type.

    Scatter Chart 3D

    Note

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

    • Native Example
    • Xamarin Example

    The Scatter Series 3D requires a shape to be specified using the Point Markers 3D. SciChart provides several shapes out of the box:

    Flat-Texture PointMarkers Mesh (Volumetric) PointMarkers
    TrianglePointerMarker3D PyramidPointMarker3D
    QuadPointMarker3D CubePointMarker3D
    EllipsePointMarker3D SpherePointMarker3D
    PixelPointMarker3D CylinderPointMarker3D
    CustomPointMarker3D

    It is also possible to define custom texture for the Point Markers via the CustomPointMarker3D. Please refer to the PointMarkers 3D API article to learn more. You can also override colors of the Point Markers 3D individually using The MetadataProvider API.

    Create a 3D Scatter Series

    To create a ScatterRenderableSeries3D, use the following code:

    • Java
    • Java with Builders API
    • Kotlin
    final NumericAxis3D xAxis = new NumericAxis3D();
    xAxis.setGrowBy(new DoubleRange(.1, .1));
    
    final NumericAxis3D yAxis = new NumericAxis3D();
    yAxis.setGrowBy(new DoubleRange(.1, .1));
    
    final NumericAxis3D zAxis = new NumericAxis3D();
    zAxis.setGrowBy(new DoubleRange(.1, .1));
    
    final XyzDataSeries3D<Double, Double, Double> ds = new XyzDataSeries3D<>(Double.class, Double.class, Double.class);
    for (int i = 0; i < 250; i++) {
        final double x = dataManager.getGaussianRandomNumber(15, 1.5);
        final double y = dataManager.getGaussianRandomNumber(15, 1.5);
        final double z = dataManager.getGaussianRandomNumber(15, 1.5);
        ds.append(x, y, z);
    }
    
    final SpherePointMarker3D pointMarker = new SpherePointMarker3D();
    pointMarker.setSize(10);
    pointMarker.setFill(0xFF32CD32);
    
    final ScatterRenderableSeries3D rs = new ScatterRenderableSeries3D();
    rs.setDataSeries(ds);
    rs.setPointMarker(pointMarker);
    
    UpdateSuspender.using(surface, () -> {
        surface.setXAxis(xAxis);
        surface.setYAxis(yAxis);
        surface.setZAxis(zAxis);
        surface.getRenderableSeries().add(rs);
        surface.getChartModifiers().add(createDefaultModifiers3D());
    });
    
    final NumericAxis3D xAxis = sciChart3DBuilder.newNumericAxis3D().withGrowBy(.1, .1).build();
    final NumericAxis3D yAxis = sciChart3DBuilder.newNumericAxis3D().withGrowBy(.1, .1).build();
    final NumericAxis3D zAxis = sciChart3DBuilder.newNumericAxis3D().withGrowBy(.1, .1).build();
    
    final XyzDataSeries3D<Double, Double, Double> ds = new XyzDataSeries3D<>(Double.class, Double.class, Double.class);
    for (int i = 0; i < 250; i++) {
        final double x = dataManager.getGaussianRandomNumber(15, 1.5);
        final double y = dataManager.getGaussianRandomNumber(15, 1.5);
        final double z = dataManager.getGaussianRandomNumber(15, 1.5);
        ds.append(x, y, z);
    }
    
    final SpherePointMarker3D pointMarker = sciChart3DBuilder.newSpherePointMarker3D()
            .withFill(0xFF32CD32)
            .withSize(10)
            .build();
    
    final ScatterRenderableSeries3D rs = sciChart3DBuilder.newScatterSeries3D()
            .withDataSeries(ds)
            .withPointMarker(pointMarker)
            .build();
    
    UpdateSuspender.using(surface, () -> {
        surface.setXAxis(xAxis);
        surface.setYAxis(yAxis);
        surface.setZAxis(zAxis);
        surface.getRenderableSeries().add(rs);
        surface.getChartModifiers().add(createDefaultModifiers3D());
    });
    
    val xAxis = NumericAxis3D()
    xAxis.growBy = DoubleRange(.1, .1)
    val yAxis = NumericAxis3D()
    yAxis.growBy = DoubleRange(.1, .1)
    val zAxis = NumericAxis3D()
    zAxis.growBy = DoubleRange(.1, .1)
    
    val ds = XyzDataSeries3D(
        Double::class.java,
        Double::class.java,
        Double::class.java
    )
    
    for (i in 0..249) {
        val x: Double = dataManager.getGaussianRandomNumber(15.0, 1.5)
        val y: Double = dataManager.getGaussianRandomNumber(15.0, 1.5)
        val z: Double = dataManager.getGaussianRandomNumber(15.0, 1.5)
        ds.append(x, y, z)
    }
    
    val pointMarker = SpherePointMarker3D()
    pointMarker.size = 10f
    pointMarker.fill = 0xFF32CD32.toInt()
    
    val rs = ScatterRenderableSeries3D()
    rs.dataSeries = ds
    rs.pointMarker = pointMarker
    
    UpdateSuspender.using(surface) {
        surface.xAxis = xAxis
        surface.yAxis = yAxis
        surface.zAxis = zAxis
        surface.renderableSeries.add(rs)
        surface.chartModifiers.add(createDefaultModifiers3D())
    }
    

    In the code above, a Scatter Series instance is created and assigned to draw the data provided by the IDataSeries3D<TX,TY,TZ> assigned to it. The Scatters 3D are drawn with a PointMarker provided by the SpherePointMarker3D instance. Finally, the 3D Scatter Series is added to the getRenderableSeries() collection.

    Paint Scatters With Different Colors

    Is SciChart, you can draw each scatter of the Scatter Series 3D with the different color using the MetadataProvider API. To use MetadataProvider for scatters 3D - a custom IPointMetadataProvider3D has to be provided to the metadataProvider property. Also, there is PointMetadataProvider3D provided out of the box, as a general case for Scatter Series 3D.

    Individually colored Scatter Series 3D are also known as Bubble 3D Chart. Please visit the corresponding article for more information about it.

    Note

    To learn more about coloring IRenderableSeries3D points individually - refer to the MetadataProvider API article for more info.

    Back to top © 2011-2025 SciChart. All rights reserved. | sitemap.xml