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.
Demonstrates how to use PointLinesRenderableSeries3D type to create a 3D Simple PointLines Chart with SciChart for your Android applications.
The 3D PointLines Charts are often used in science and engineering fields, allowing for complex data visualization, showing overall values and shapes as well as emphasizing the specifics.
The PointLinesRenderableSeries3D type supports multiple PointMarkers in 3D, including: SpherePointMarker3D, CubePointMarker3D, PyramidPointMarker3D, CylinderPointMarker3D and more Fast 2D Marker types.
Read more in the Android PointLine 3D Chart Type Documentation.
The full source code for the Android 3D Simple PointLines Chart 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
//
// PointLine3DChartFragment.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.metadataProviders.PointMetadataProvider3D
import com.scichart.charting3d.visuals.renderableSeries.metadataProviders.PointMetadataProvider3D.PointMetadata3D
import com.scichart.data.model.DoubleRange
import com.scichart.drawing.utility.ColorUtil
import com.scichart.examples.data.DataManager
import com.scichart.examples.fragments.base.ExampleSingleChart3DBaseFragment
import com.scichart.examples.utils.scichartExtensions.*
import kotlin.math.cos
import kotlin.math.sin
class PointLine3DChartFragment : ExampleSingleChart3DBaseFragment() {
override fun initExample(surface3d: SciChartSurface3D) {
val dataManager = DataManager.getInstance()
val pointMetadataProvider3D = PointMetadataProvider3D()
surface3d.suspendUpdates {
xAxis = numericAxis3D { growBy = DoubleRange(0.1, 0.1) }
yAxis = numericAxis3D { growBy = DoubleRange(0.1, 0.1) }
zAxis = numericAxis3D { growBy = DoubleRange(0.1, 0.1) }
renderableSeries {
pointLineRenderableSeries3D {
spherePointMarker3D { fill = ColorUtil.Red; size = 5f }
xyzDataSeries3D<Double, Double, Double> {
val metadata = pointMetadataProvider3D.metadata
for (i in 0..99) {
val x = 5 * sin(i.toDouble())
val y = i.toDouble()
val z = 5 * cos(i.toDouble())
append(x, y, z)
metadata.add(PointMetadata3D(dataManager.randomColor, dataManager.randomScale))
}
}
stroke = ColorUtil.Green
strokeThickness = 2f
isAntialiased = false
isLineStrips = true
metadataProvider = pointMetadataProvider3D
}
}
chartModifiers { defaultModifiers3D()}
}
}
}
//******************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2021. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// CreatePointLine3DChartFragment.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 androidx.annotation.NonNull;
import com.scichart.charting3d.model.dataSeries.xyz.XyzDataSeries3D;
import com.scichart.charting3d.visuals.SciChartSurface3D;
import com.scichart.charting3d.visuals.axes.NumericAxis3D;
import com.scichart.charting3d.visuals.pointMarkers.SpherePointMarker3D;
import com.scichart.charting3d.visuals.renderableSeries.metadataProviders.PointMetadataProvider3D;
import com.scichart.charting3d.visuals.renderableSeries.metadataProviders.PointMetadataProvider3D.PointMetadata3D;
import com.scichart.charting3d.visuals.renderableSeries.pointLine.PointLineRenderableSeries3D;
import com.scichart.core.framework.UpdateSuspender;
import com.scichart.drawing.utility.ColorUtil;
import com.scichart.examples.data.DataManager;
import com.scichart.examples.fragments.base.ExampleSingleChart3DBaseFragment;
import java.util.List;
public class PointLine3DChartFragment extends ExampleSingleChart3DBaseFragment {
@Override
protected void initExample(@NonNull SciChartSurface3D surface3d) {
final DataManager dataManager = DataManager.getInstance();
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 pointMetadataProvider3D = new PointMetadataProvider3D();
final List<PointMetadata3D> metadata = pointMetadataProvider3D.metadata;
for (int i = 0; i < 100; i++) {
final double x = 5 * Math.sin(i);
final double y = i;
final double z = 5 * Math.cos(i);
xyzDataSeries3D.append(x, y, z);
metadata.add(new PointMetadata3D(dataManager.getRandomColor(), dataManager.getRandomScale()));
}
final SpherePointMarker3D pointMarker = sciChart3DBuilder.newSpherePointMarker3D()
.withFill(ColorUtil.Red)
.withSize(5f)
.build();
final PointLineRenderableSeries3D rs = sciChart3DBuilder.newPointLinesSeries3D()
.withDataSeries(xyzDataSeries3D)
.withPointMarker(pointMarker)
.withStroke(ColorUtil.Green)
.withStrokeThicknes(2f)
.withIsAntialiased(false)
.withIsLineStrips(true)
.withMetadataProvider(pointMetadataProvider3D)
.build();
UpdateSuspender.using(surface3d, () -> {
surface3d.setXAxis(xAxis);
surface3d.setYAxis(yAxis);
surface3d.setZAxis(zAxis);
surface3d.getRenderableSeries().add(rs);
surface3d.getChartModifiers().add(sciChart3DBuilder.newModifierGroupWithDefaultModifiers().build());
});
}
}