Multitouch (pinch) with chartview

2 posts, 0 answers
  1. Carmen
    Carmen avatar
    10 posts
    Member since:
    Dec 2015

    Posted 07 Jan Link to this post



    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.




  2. Todor
    Todor avatar
    772 posts

    Posted 12 Jan Link to this post

    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.

    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
  3. DevCraft R3 2016 release webinar banner
Back to Top