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

3D Column Charts are provided by the ColumnRenderableSeries3D type.

 


Declaring a 3D Column Chart

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

The above graph is rendered with the following code:

Column 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, 0.5).build();
final NumericAxis3D zAxis = sciChart3DBuilder.newNumericAxis3D().withGrowBy(.1, .1).build();

final ColumnRenderableSeries3D rs = sciChart3DBuilder.newColumnSeries3D()
        .withFill(ColorUtil.DodgerBlue)
        .withDataSeries(ds)
        .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());
    }
});

Single Row Column 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 Column 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 ColumnRenderableSeries3D rs = sciChart3DBuilder.newColumnSeries3D()
        .withFill(ColorUtil.DodgerBlue)
        .withDataSeries(ds)
        .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 Column Shapes

The column shape can be defined by one of several pointmarkers, including:


Setting Column Sizes

Column sizes are set as a ratio of the available space between the neighbouring points.

Setting the properties DataPointWidthDataPointWidthXDataPointWidthZ changes the ratio of space allocated to the column in the X & Z direction.