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 support selection of a data point, demonstrated at this Scatter Point 3D Chart Selection example.
Tap on a scatter point to select one. You may select several points.How to use the example! Tap on an already selected point or do a long press on the free chart space to deselect.
The selection of points in SciChart Android 3D is provided by VertexSelectionModifier3D.
Please read on a documentation article about Vertex Selection Modifier in SciChart Android 3D Charts.
The full source code for the Android 3D Select Scatter Point 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
//
// SelectScatterPoint3DChartFragment.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.tooltipsAndHitTest3DCharts.kt
import com.scichart.charting3d.visuals.SciChartSurface3D
import com.scichart.charting3d.visuals.renderableSeries.metadataProviders.DefaultSelectableMetadataProvider3D
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.*
class SelectScatterPoint3DChartFragment : ExampleSingleChart3DBaseFragment() {
override fun initExample(surface3d: SciChartSurface3D) {
val dataManager = DataManager.getInstance()
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 {
scatterRenderableSeries3D {
xyzDataSeries3D<Double, Double, Double> {
for (i in 0 until 250) {
val x = dataManager.getGaussianRandomNumber(5.0, 1.5)
val y = dataManager.getGaussianRandomNumber(5.0, 1.5)
val z = dataManager.getGaussianRandomNumber(5.0, 1.5)
append(x, y, z)
}
ellipsePointMarker3D { fill = ColorUtil.LimeGreen; size = 5f }
//set ISelectableMetadataProvider3D because we're going to use vertex selection for this series
metadataProvider = DefaultSelectableMetadataProvider3D()
}
}
}
chartModifiers {
pinchZoomModifier3D()
orbitModifier3D { receiveHandledEvents = true }
zoomExtentsModifier3D()
vertexSelectionModifier3D { receiveHandledEvents = true }
}
}
}
}
//******************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2021. All rights reserved.
//
// Web: http://www.scichart.com
// Support: support@scichart.com
// Sales: sales@scichart.com
//
// SelectScatterPoint3DChartFragment.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.tooltipsAndHitTest3DCharts;
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.EllipsePointMarker3D;
import com.scichart.charting3d.visuals.renderableSeries.metadataProviders.DefaultSelectableMetadataProvider3D;
import com.scichart.charting3d.visuals.renderableSeries.scatter.ScatterRenderableSeries3D;
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;
public class SelectScatterPoint3DChartFragment extends ExampleSingleChart3DBaseFragment {
@Override
protected void initExample(@NonNull SciChartSurface3D surface3d) {
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 DataManager dataManager = DataManager.getInstance();
final XyzDataSeries3D<Double, Double, Double> dataSeries = new XyzDataSeries3D<>(Double.class, Double.class, Double.class);
for (int i = 0; i < 250; i++) {
final double x = dataManager.getGaussianRandomNumber(5, 1.5);
final double y = dataManager.getGaussianRandomNumber(5, 1.5);
final double z = dataManager.getGaussianRandomNumber(5, 1.5);
dataSeries.append(x, y, z);
}
final EllipsePointMarker3D pointMarker3D = sciChart3DBuilder.newEllipsePointMarker3D()
.withFill(ColorUtil.LimeGreen)
.withSize(5f)
.build();
final ScatterRenderableSeries3D rs = sciChart3DBuilder.newScatterSeries3D()
.withDataSeries(dataSeries)
.withPointMarker(pointMarker3D)
//set ISelectableMetadataProvider3D because we're going to use vertex selection for this series
.withMetadataProvider(new DefaultSelectableMetadataProvider3D())
.build();
UpdateSuspender.using(surface3d, () -> {
surface3d.setXAxis(xAxis);
surface3d.setYAxis(yAxis);
surface3d.setZAxis(zAxis);
surface3d.getRenderableSeries().add(rs);
surface3d.getChartModifiers().add(sciChart3DBuilder.newModifierGroup()
.withPinchZoomModifier3D().build()
.withOrbitModifier3D().withReceiveHandledEvents(true).build()
.withZoomExtentsModifier3D().build()
.withVertexSelectionModifier().withReceiveHandledEvents(true).build()
.build());
});
}
}