Scroll event with ChartPanAndZoomBehavior

4 posts, 0 answers
  1. Alexey
    Alexey avatar
    21 posts
    Member since:
    Aug 2013

    Posted 14 May 2014 Link to this post

    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?
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 19 May 2014 Link to this post

    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.

     
  3. DevCraft banner
  4. Alexey
    Alexey avatar
    21 posts
    Member since:
    Aug 2013

    Posted 19 May 2014 in reply to Victor Link to this post

    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
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 22 May 2014 Link to this post

    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.

     
Back to Top
DevCraft banner