Android point selection delay


#1

I noticed that in the Android version of ShinobiCharts, there is a rather significant delay (approximate 0.5s-1s) between the moment a point is tapped and the moment it appears as selected on the screen. This results in a less than ideal user experience. My guess is that this delay is used to make sure the tap is not the first part of another gesture such as a double-tap, but it occurs even if double-tap to zoom is not enabled. Is there any way this delay can be reduced or eliminated?


#2

Hello,

I have responded to your email, but I am also pasting my response here, for completeness:

Hello.

Thank you for your query.

The delay which you mention is generally down to the calculations that need to be undertaken in order to determine the nearest data point to the user gesture. Unfortunately, this delay is not adjustable via our API. 

In principle, you may be able to achieve more desirable results by implementing the selection aspect yourself. You could potentially use the OnGestureListener -

https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.7.2/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/ShinobiChart.OnGestureListener.html

to handle ‘onSingleTouchUp’. In this method you could use the following method to programmatically set points to be selected:

https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.7.2/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/Series.html#setPointSelected(boolean, int)

The area which may be a little tricky however is the code which calculates the nearest data point to the user gesture. The following methods may help you work from pixel terms to data terms to help you with the calculations:

https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.7.2/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/Axis.html#getUserValueForPixelValue(float)

https://www.shinobicontrols.com/docs/ShinobiControls/ShinobiChartsAndroid/1.7.2/Premium/Normal/apidocs/docs/reference/com/shinobicontrols/charts/Axis.html#getPixelValueForUserValue(T)

I hope that you find this information useful.

Thanks and kind regards, 

Kai.