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

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

1 Answer 311 Views
Chart
This is a migrated thread and some comments may be shown as answers.
cameron
Top achievements
Rank 1
cameron asked on 23 May 2018, 07:17 AM

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?

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 28 May 2018, 11:36 AM
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
Tags
Chart
Asked by
cameron
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or