SciChart Android 3D Charts API > 3D Chart Types > The Free Surface 3D Chart Type > The Polar 3D Chart Type
The Polar 3D Chart Type

Polar 3D Charts are provided by the PolarDataSeries3D type.

 

The location of the PolarDataSeries3D is defined by following properties:

  • OffsetX – a location of the Polar by the X-Axis
  • OffsetY – a location of the Polar by the Y-Axis
  • OffsetZ – a location of the Polar by the Z-Axis

The size of the PolarDataSeries3D is defined by following properties:

  • A – a distance from the origin to the internal edge of the polar 3D Surface
  • B – a distance from the origin to the external edge of the polar 3D Surface
    Polar 3D
    Copy Code
    final Camera3D camera = sciChart3DBuilder.newCamera3D().build();
    surface3d.getWorldDimensions().assign(200, 50, 200);
    final NumericAxis3D xAxis = sciChart3DBuilder.newNumericAxis3D().withVisibleRange(-7, 7).withAutoRangeMode(AutoRange.Never).build();
    final NumericAxis3D yAxis = sciChart3DBuilder.newNumericAxis3D().withVisibleRange(-7, 7).withAutoRangeMode(AutoRange.Never).build();
    final NumericAxis3D zAxis = sciChart3DBuilder.newNumericAxis3D().withVisibleRange(-7, 7).withAutoRangeMode(AutoRange.Never).build();
    final int sizeU = 30, sizeV = 10;
    final PolarDataSeries3D<Double, Double> meshDataSeries = new PolarDataSeries3D<>(Double.class, Double.class, sizeU, sizeV, 0d, Math.PI * 1.75);
    meshDataSeries.setA(1d);
    meshDataSeries.setB(5d);
    final Random random = new Random();
    for (int u = 0; u < sizeU; u++) {
        final double weightU = 1d - Math.abs(2d * u / sizeU - 1d);
        for (int v = 0; v < sizeV; v++) {
            final double weightV = 1d - Math.abs(2d * v / sizeV - 1d);
            final double offset = random.nextDouble();
            meshDataSeries.setDisplacement(u, v, offset * weightU * weightV);
        }
    }
    final int[] colors = {0xFF1D2C6B, Blue, Cyan, GreenYellow, Yellow, Red, DarkRed};
    final float[] stops = {0, .1f, .3f, .5f, .7f, .9f, 1};
    final FreeSurfaceRenderableSeries3D rs = sciChart3DBuilder.newFreeSurfaceSeries3D()
            .withDataSeries(meshDataSeries)
            .withDrawMeshAs(DrawMeshAs.SolidWireframe)
            .withStroke(0x77228B22)
            .withContourInterval(0.1f)
            .withContourStroke(0x77228B22)
            .withStrokeThicknes(1f)
            .withLightingFactor(0.8f)
            .withMeshColorPalette(new GradientColorPalette(colors, stops))
            .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());
        }
    });