SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
SciChart Android ships with ~90Â Android Chart Examples which you can browse, play with, view the source-code and even export each SciChart Android Chart Example to a stand-alone Android Studio project. All of this is possible with the new and improved SciChart Android Examples Suite, which ships as part of our Android Charts SDK.
SciChart Android 3D Charting Library supports plotting the basic Surface Meshes. The Uniform Mesh 3D Chart is provided by SurfaceMeshRenderableSeries3D and UniformGridDataSeries3D Type.
This versatile chart type allows a number of configurable chart types in SciChart Android 3D, including rendering of 3D surfaces / dynamic or updating surfaces (terrains or height maps) / grids / contour mapping or wire frame / spectrogram and heatmaps which could be used for visualizing Topology data, Statistical analysis, Volatility Smiles etc.
Please read more about The SurfaceMesh 3D Chart Type in SciChart Android Documentation.
The full source code for the Android 3D Simple Uniform Mesh example is included below (Scroll down!).
Did you know you can also view the source code from one of the following sources as well?
//******************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2021. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// UniformMesh3DChartFragment.kt is part of SCICHART®, High Performance Scientific Charts
// For full terms and conditions of the license, see http://www.scichart.com/scichart-eula/
//
// This source code is protected by international copyright law. Unauthorized
// reproduction, reverse-engineering, or distribution of all or any portion of
// this source code is strictly prohibited.
//
// This source code contains confidential and proprietary trade secrets of
// SciChart Ltd., and should at no time be copied, transferred, sold,
// distributed or made available without express written permission.
//******************************************************************************
package com.scichart.examples.fragments.examples3d.basicChartTypes.kt
import com.scichart.charting3d.visuals.SciChartSurface3D
import com.scichart.charting3d.visuals.renderableSeries.data.DrawMeshAs.SolidWireframe
import com.scichart.charting3d.visuals.renderableSeries.data.GradientColorPalette
import com.scichart.data.model.DoubleRange
import com.scichart.drawing.utility.ColorUtil.*
import com.scichart.examples.fragments.base.ExampleSingleChart3DBaseFragment
import com.scichart.examples.utils.scichartExtensions.*
import kotlin.math.sin
class UniformMesh3DChartFragment : ExampleSingleChart3DBaseFragment() {
override fun initExample(surface3d: SciChartSurface3D) {
surface3d.suspendUpdates {
xAxis = numericAxis3D { growBy = DoubleRange(0.1, 0.1) }
yAxis = numericAxis3D { growBy = DoubleRange(0.1, 0.1); visibleRange = DoubleRange(0.0, 0.3) }
zAxis = numericAxis3D { growBy = DoubleRange(0.1, 0.1) }
renderableSeries {
surfaceMeshRenderableSeries3D {
uniformGridDataSeries3D<Double, Double, Double>(xSize, zSize) {
for (x in 0 until xSize) {
for (z in 0 until zSize) {
val xVal = 25.0 * x / xSize
val zVal = 25.0 * z / zSize
val y = sin(xVal * .2) / ((zVal + 1) * 2)
updateYAt(x, z, y)
}
}
}
drawMeshAs = SolidWireframe
stroke = 0x77228B22
contourStroke = 0x77228B22
strokeThickness = 1f
drawSkirt = false
meshColorPalette = GradientColorPalette(
intArrayOf(0xFF1D2C6B.toInt(), Blue, Cyan, GreenYellow, Yellow, Red, DarkRed),
floatArrayOf(0f, .1f, .3f, .5f, .7f, .9f, 1f)
)
}
}
chartModifiers { defaultModifiers3D()}
}
}
companion object {
const val xSize = 25
const val zSize = 25
}
}
//******************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2021. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// CreateUniformMesh3DChartFragment.java is part of SCICHART®, High Performance Scientific Charts
// For full terms and conditions of the license, see http://www.scichart.com/scichart-eula/
//
// This source code is protected by international copyright law. Unauthorized
// reproduction, reverse-engineering, or distribution of all or any portion of
// this source code is strictly prohibited.
//
// This source code contains confidential and proprietary trade secrets of
// SciChart Ltd., and should at no time be copied, transferred, sold,
// distributed or made available without express written permission.
//******************************************************************************
package com.scichart.examples.fragments.examples3d.basicChartTypes;
import com.scichart.charting3d.model.dataSeries.grid.UniformGridDataSeries3D;
import com.scichart.charting3d.visuals.SciChartSurface3D;
import com.scichart.charting3d.visuals.axes.NumericAxis3D;
import com.scichart.charting3d.visuals.renderableSeries.data.DrawMeshAs;
import com.scichart.charting3d.visuals.renderableSeries.data.GradientColorPalette;
import com.scichart.charting3d.visuals.renderableSeries.surfaceMesh.SurfaceMeshRenderableSeries3D;
import com.scichart.core.framework.UpdateSuspender;
import com.scichart.examples.fragments.base.ExampleSingleChart3DBaseFragment;
import static com.scichart.drawing.utility.ColorUtil.*;
import androidx.annotation.NonNull;
public class UniformMesh3DChartFragment extends ExampleSingleChart3DBaseFragment {
@Override
protected void initExample(@NonNull SciChartSurface3D surface3d) {
final NumericAxis3D xAxis = sciChart3DBuilder.newNumericAxis3D().withGrowBy(.1, .1).build();
final NumericAxis3D yAxis = sciChart3DBuilder.newNumericAxis3D().withVisibleRange(0, .3).withGrowBy(.1, .1).build();
final NumericAxis3D zAxis = sciChart3DBuilder.newNumericAxis3D().withGrowBy(.1, .1).build();
final int xSize = 25;
final int zSize = 25;
final UniformGridDataSeries3D<Double, Double, Double> ds = new UniformGridDataSeries3D<>(Double.class, Double.class, Double.class, xSize, zSize);
for (int x = 0; x < xSize; x++) {
for (int z = 0; z < zSize; z++) {
final double xVal = 25.0 * x / xSize;
final double zVal = 25.0 * z / zSize;
final double y = Math.sin(xVal * .2) / ((zVal+1) * 2);
ds.updateYAt(x, z, y);
}
}
final SurfaceMeshRenderableSeries3D rs = sciChart3DBuilder.newSurfaceMeshSeries3D()
.withDataSeries(ds)
.withDrawMeshAs(DrawMeshAs.SolidWireframe)
.withStroke(0x77228B22)
.withContourStroke(0x77228B22)
.withStrokeThicknes(1f)
.withDrawSkirt(false)
.withMeshColorPalette(new GradientColorPalette(
new int[]{0xFF1D2C6B, Blue, Cyan, GreenYellow, Yellow, Red, DarkRed},
new float[]{0, .1f, .3f, .5f, .7f, .9f, 1})
)
.build();
UpdateSuspender.using(surface3d, () -> {
surface3d.setXAxis(xAxis);
surface3d.setYAxis(yAxis);
surface3d.setZAxis(zAxis);
surface3d.getRenderableSeries().add(rs);
surface3d.getChartModifiers().add(sciChart3DBuilder.newModifierGroupWithDefaultModifiers().build());
});
}
}