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

Scroll event with ChartPanAndZoomBehavior

3 Answers 88 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.
Alexey
Top achievements
Rank 1
Alexey asked on 14 May 2014, 06:47 PM
Hi
Is there any way to handle scroll event with ChartPanAndZoomBehavior?
I want implement chart with Pan gesture support and while user dragging chart I want fetch more data and add it to the chart. But the problem that there is no event to handle such behavior. What can you suggest?

3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 19 May 2014, 07:51 AM
Hello Alexey,

Thanks for writing.
This feature is called load on demand and currently the chart does not support it out of the box. Since the chart does not expose events at the moment, you can create a dependency property and bind it to the chart's Pan property. This way you will be able to listen to property changes and when the property value gets to the maximum pan you can load more data.

I agree that's not the most convenient way but it should do the trick. We will see what we can do to improve the chart API for a future release.

Please write again if you need further assistance.

Regards,
Victor
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Alexey
Top achievements
Rank 1
answered on 19 May 2014, 09:21 AM
Hi
Could you please provide more details about suggested solution?
As I understand I need create new class inherited from Chart with additional properties and use some protected methods
0
Victor
Telerik team
answered on 22 May 2014, 08:40 AM
Hi Alexey,

It is not strictly necessary to inherit from the chart. If you create a DependencyProperty of type Size on the page that hosts your chart, you can then bind this property to the Zoom property of RadChart. Then whenever the chart updates its zoom you will be notified through the property changed callback that you specified when you created your property.

Then it is a matter of calculating how much pan is required to scroll the chart to the end. Please have a look at the attached app. It contains a sample implementation.

Regards,
Victor
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart
Asked by
Alexey
Top achievements
Rank 1
Answers by
Victor
Telerik team
Alexey
Top achievements
Rank 1
Share this question
or