Referring to the stacked column side by side example in the android examples collection, if someone clicks on a column/series in that chart, how could i identify which the of columns has been selected (usa, china, india, etc).
- Marcus Maringer asked 4 years ago
- You must login to post comments
Hi Marcus,
I’m afraid we have a limited support of SeriesSelectionModifier for stacked series, because it can only select/deselect entire renderable series from renderable series collection of chart, so in case of stacked series it can only select/deselect all series or none of them. To add proper support for stacked series you would need to create custom selection modifier.
Theretically you can use our hit test API ( we have an example which shows how to use it ) to determine which renderable series was hit at specified coordinates of chart (https://www.scichart.com/documentation/android/current/webframe.html#SciChart.Charting~com.scichart.charting.visuals.renderableSeries.hitTest.HitTestInfo~hitRenderableSeries.html). You can get series name from this HitTestInfo like this and check if match name set for DataSeries(e.g. USA, China, India etc ):
final IRenderableSeries hitRenderableSeries = hitTestInfo.hitRenderableSeries;
if(hitRenderableSeries != null) {
final String seriesName = hitRenderableSeries.getDataSeries().getSeriesName();
}
Hope this will help you!
Best regards,
Yura
- Yura Khariton answered 4 years ago
- Thank Yura for your quick reply. that seems to work thanks. Although I am wondering why the onTouch event is always called twice (its also called twice in the hit test api example)
- i am using the onSingleTapConfirmed of custom SelectionModifier instead
- Hi Marcus, onTouch() is internally called by Android OS during dispatching MotionEvent through View hierarchy. Have you checked MotionEvent’s action? I believe it’s possible that first time it could be ACTION_DOWN and second time ACTION_UP.
- You must login to post comments
Good site – https://www.scichart.com/
- Monica Brown answered 4 years ago
- You must login to post comments
Please login first to submit.