Android onPointSelectionStateChanged


#1

I’m trying to capture when a user taps on a line series data point.  I’ve set an OnSeriesSelectionListener

shinobiChart.setOnSeriesSelectionListener(this);

and implemented onPointSelectionStateChanged:

public void onPointSelectionStateChanged(Series<?> series, int i) {
        Log.d(_TAG, "--- Start onPointSelectionStateChanged ---");

}

Set large radius on the point

LineSeries lineSeries = new LineSeries();
                LineSeriesStyle style = new LineSeriesStyle();
                PointStyle pointStyle = new PointStyle();
                pointStyle.setColor(Color.BLACK);
                pointStyle.setInnerColor(Color.BLACK);
                pointStyle.setRadius(20f);
                pointStyle.setPointsShown(true);
                style.setPointStyle(pointStyle);
                style.setLineShown(false);
                lineSeries.setCrosshairEnabled(true);
                lineSeries.setStyle(style);

However when tapping on a data point in the line series onPointSelectionStateChanged is not getting executed. Any suggestions?

Update: I’ve figured out what I was doing wrong.  Once  setting the series selection mode onPointSelectionStateChanged is now executing when a data point is tapped.  I added the following line:

lineSeries.setSelectionMode(Series.SelectionMode.POINT_SINGLE);