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

3D Scatter Charts are provided by the ScatterRenderableSeries3D type, which requires a PointMarker.

The ScatterRenderableSeries3D supports multiple pointmarkers, including:

3D Marker Types

Fast 2D Marker types

Declaring a 3D Scatter Series

To declare a 3D Scatter Series with PointMarker use the following code:

3D Scatter Series
Copy Code
final Camera3D camera = sciChart3DBuilder.newCamera3D().build();
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 DataManager dataManager = DataManager.getInstance();
final XyzDataSeries3D<Double, Double, Double> dataSeries = new XyzDataSeries3D<>(Double.class, Double.class, Double.class);
for (int i = 0; i < 1000; i++) {
    final double x = dataManager.getGaussianRandomNumber(5, 1.5);
    final double y = dataManager.getGaussianRandomNumber(5, 1.5);
    final double z = dataManager.getGaussianRandomNumber(5, 1.5);
    dataSeries.append(x, y, z);
}
final EllipsePointMarker3D pointMarker3D = sciChart3DBuilder.newEllipsePointMarker3D()
        .withFill(ColorUtil.LimeGreen)
        .withSize(2f)
        .build();
final ScatterRenderableSeries3D rs = sciChart3DBuilder.newScatterSeries3D()
        .withDataSeries(dataSeries)
        .withPointMarker(pointMarker3D)
        .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);
    }
});

Coloring Individual Scatter Points

Scatter points may be colored or scaled individually using the PointMetada3D API. To do this, set a PointMetada3D instance at the data-point as follows:

MetadataProvider 3D
Copy Code
final PointMetadataProvider3D metadataProvider = new PointMetadataProvider3D();
final DataManager dataManager = DataManager.getInstance();
final ObservableCollection<PointMetadataProvider3D.PointMetadata3D> medatata = metadataProvider.metadata;

for (int i = 0; i < 250; i++) {
     final int color = dataManager.getRandomColor();
     final float scale = dataManager.getRandomScale();
     medatata.add(new PointMetadataProvider3D.PointMetadata3D(color, scale));
}

final ScatterRenderableSeries3D rs = sciChart3DBuilder.newScatterSeries3D()
         .withMetadataProvider(metadataProvider)
         .build();