SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

0
0

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).

Version
4
  • You must to post comments
0
0

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

  • Marcus Maringer
    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)
  • Marcus Maringer
    i am using the onSingleTapConfirmed of custom SelectionModifier instead
  • Yura Khariton
    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 to post comments
Showing 1 result
Your Answer

Please first to submit.