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

3D Impulse or Stem Charts are provided by the ImpulseRenderableSeries3D type.

A stem chart is visualized by small stems pointing up or down to a value with a sphere or marker at the top.

 


Declaring a 3D Impulse Chart

The ImpulseRenderableSeries3D accepts either XyzDataSeries3D for sparse points, or UniformGridDataSeries3D for an NxM array of points.

The above graph is rendered with the following code:

Impulse 3D Chart
Copy Code
final UniformGridDataSeries3D<Double, Double, Double> ds = new UniformGridDataSeries3D<>(Double.class, Double.class, Double.class, COUNT, COUNT);
for (int x = 0; x < COUNT; x++) {
    for (int z = 0; z < COUNT; z++) {
        final double y = Math.sin(x * .25) / ((z + 1) * 2);
        ds.updateYAt(x, z, y);
    }
}
final Camera3D camera = sciChart3DBuilder.newCamera3D().build();
final NumericAxis3D xAxis = sciChart3DBuilder.newNumericAxis3D().withGrowBy(.1, .1).build();
final NumericAxis3D yAxis = sciChart3DBuilder.newNumericAxis3D().withVisibleRange(0, .5).withGrowBy(.1, .1).build();
final NumericAxis3D zAxis = sciChart3DBuilder.newNumericAxis3D().withGrowBy(.1, .1).build();
final ImpulseRenderableSeries3D rs = sciChart3DBuilder.newImpulseSeries3D()
        .withDataSeries(ds)
        .withStroke(ColorUtil.DodgerBlue)
        .withStrokeThicknes(1f)
        .withPointMarker(sciChart3DBuilder.newSpherePointMarker3D().withSize(5).withFill(ColorUtil.DodgerBlue).build())
        .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());
     }
});

However it could be just as easily created with an XyzDataSeries3D as the DataSeries for sparse columns.


Single Row Impulse 3D Charts

By changing a few parameters, it is possible to get a column chart to look like this:

The code to achieve the above is as follows:

Single Row Impulse 3D Chart
Copy Code
final UniformGridDataSeries3D<Double, Double, Double> ds = new UniformGridDataSeries3D<>(Double.class, Double.class, Double.class, COUNT, 1);
for (int x = 0; x < COUNT; x++) {
    for (int z = 0; z < 1; z++) {
        final double y = Math.sin(x * .25) / ((z + 1) * 2);
        ds.updateYAt(x, z, y);
    }
}
final Camera3D camera = sciChart3DBuilder.newCamera3D().build();
final NumericAxis3D xAxis = sciChart3DBuilder.newNumericAxis3D().build();
final NumericAxis3D yAxis = sciChart3DBuilder.newNumericAxis3D().withVisibleRange(0, 0.5).build();
final NumericAxis3D zAxis = sciChart3DBuilder.newNumericAxis3D().withDrawLabels(false).build();
final ImpulseRenderableSeries3D rs = sciChart3DBuilder.newImpulseSeries3D()
        .withDataSeries(ds)
        .withStroke(ColorUtil.DodgerBlue)
        .withStrokeThicknes(1f)
        .withPointMarker(sciChart3DBuilder.newSpherePointMarker3D().withSize(5).withFill(ColorUtil.DodgerBlue).build())
        .build();
UpdateSuspender.using(surface3d, new Runnable() {
     @Override
     public void run() {
        surface3d.getWorldDimensions().assign(200, 100, 20);
        surface3d.setCamera(camera);
        surface3d.setXAxis(xAxis);
        surface3d.setYAxis(yAxis);
        surface3d.setZAxis(zAxis);
        surface3d.getRenderableSeries().add(rs);
        surface3d.getChartModifiers().add(sciChart3DBuilder.newModifierGroupWithDefaultModifiers().build());
    }
});

3D Impulse Shapes

The shape at the top of the stem can be defined by one of several pointmarkers, including:

Apply the Type of point marker to the PointMarker property to change the shape.