Chart inside a scrollview - how to stop it scrolling the page when panning?

2 posts, 0 answers
  1. cameron
    cameron avatar
    5 posts
    Member since:
    Apr 2018

    Posted 23 May 2018 Link to this post

    We have a page which consists of a vertical scrollview containing a stack layout with several children elements, one of which is a chart.

    The chart has a ChartPanAndZoomBehaviour attached to it with only horizontal scrolling enabled, but whenever we pan the chart the pages scrollview also reacts to the touch input and makes the chart usage awkward since the page scrolls slightly too as you drag your finger across the screen (your finger naturally wanders slightly up/down as you swipe across the screen).

    We need a way so that when a drag motion is started on the chart, it first determines the starting direction of the drag.
    - If its a vertical drag then the page scrolling is enabled but chart scrolling disabled
    - If its horizontal drag the the chart scrolling is enabled and the page scrolling disabled.

    I couldn't find any events or anything which get fired when the chart detects touch input.

    Is there a way I can make this work how we expect?

  2. Yana
    Admin
    Yana avatar
    5044 posts

    Posted 28 May 2018 Link to this post

    Hi Cameron,

    Indeed, in the described case the parent ScrollView scroll event is triggered when you pan the chart.  I am afraid that RadChart does not provide built-in events you could use, however, I would suggest that you take a look at the following forum thread: https://www.telerik.com/forums/chartpanandzoombehavior-limited-to-current-items-source#iMFHB5_DiES0Z6AffwqusQ
    where one of our users posted an approach for detecting when a pan action in RadChart occurs. 

    I hope this could help you get started with the needed implementation.

    Regards,
    Yana
    Progress 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
Back to Top