This is a migrated thread and some comments may be shown as answers.

Multitouch (pinch) with chartview

1 Answer 37 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Carmen
Top achievements
Rank 1
Carmen asked on 07 Jan 2016, 03:51 PM

Hi

 

I'd like to have my own custom behaviour for multitouch interactions on the chart view. 

 

Right now I have a onTouchListener set for my chartView

 

chartView.setOnTouchListener(new View.OnTouchListener() {

 

But when I pinch with two fingers, the setOnTouchListener is fired and there is no pinch type in the MotionEvent for me to check against, so even when I touch with two fingers, I get a one finger touch interaction.

How can I differentiate between taps and touch finger touches in the chartView.

Thanks,

Carmen

 

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 12 Jan 2016, 08:46 AM
Hi Carmen,

Thank you for your question.

Chart for Android handles some of the common gestures to provide with its features. For example, you can have a look at the behaviors section of our documentation, which demonstrates how to easily pan and zoom by simply adding a ChartPanAndZoomBehavior to the chart.

If you need custom detection of gestures, you can proceed as with any View in Android. Here's the article that explains how to use the ScaleGestureDetector that can ease the work with scale and here's another one that shows a more general approach towards the multi-touch gestures.

I hope this information helps.

Regards,
Todor
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Carmen
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or