onClick event on ChartView - Android


#1

Hi, 

This feature seems to me it’s trivial however I couldn’t find anything so far realted with it. I need to make the ChartView inactive to onClick events, so the parent container could handle it. Currently everything is clickcable in the parent container just the ChartView “consumes” the onClick event.

Thanks


#2

Hi beczesz,

We provide a callback interface called ShinobiChart.OnGestureListener which enables you to be notified of a number of different touch gesture events. So one option open to you is to set an implementation of this interface on your ShinobiChart that for certain gesture events, e.g. onSingleTouchUp, does whatever needs doing. For more details see:

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

That does still mean the ShinobiChart will consume the event. Another approach that will only work if your chart has no interactivity enabled at all (so no panning and zooming etc.) is to subclass the ChartView, overriding just the onInterceptTouchEvent method and returning true.

Obviously it depends on your specific situation but I’d probably prefer the former to the latter where possible.

I hope that helps!

Kind regards,

Patrick