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

3D Bubble Charts are provided by the ScatterRenderableSeries3D type.

 

The ScatterRenderableSeries3D supports multiple pointmarkers, including:

3D Marker Types

Fast 2D Marker types

Declaring a 3D Scatter Series with custom Sizes & Colors

To declare a 3D Scatter Series with individual sizes & colors, use the following code.

Bubble 3D Chart
Copy Code
final DataManager dataManager = DataManager.getInstance();
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 XyzDataSeries3D<Double, Double, Double> xyzDataSeries3D = new XyzDataSeries3D<>(Double.class, Double.class, Double.class);
final PointMetadataProvider3D metadataProvider = new PointMetadataProvider3D();
final ObservableCollection<PointMetadataProvider3D.PointMetadata3D> medatata = metadataProvider.metadata;
for (int i = 0; i < 250; 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);
    xyzDataSeries3D.append(x, y, z);
    final int color = dataManager.getRandomColor();
    final float scale = dataManager.getRandomScale();
    medatata.add(new PointMetadataProvider3D.PointMetadata3D(color, scale));
}
final SpherePointMarker3D pointMarker = sciChart3DBuilder.newSpherePointMarker3D()
        .withFill(ColorUtil.LimeGreen)
        .withSize(2f)
        .build();
final ScatterRenderableSeries3D rs = sciChart3DBuilder.newScatterSeries3D()
        .withDataSeries(xyzDataSeries3D)
        .withPointMarker(pointMarker)
        .withMetadataProvider(metadataProvider)
        .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);
    }
});