Timeline Zoom Speed

2 posts, 0 answers
  1. Nate
    Nate avatar
    4 posts
    Member since:
    Jul 2013

    Posted 14 May 2019 Link to this post

         I have a timeline showing events at a millisecond granularity.  I have min zoom set to 1 seconda and max set to 30 seconds. I am able to use the scroll wheel to zoom in on this graph, but the zoom is very very slow.  Is there a way to set the speed of the zoom?  For instance i would like to be able to get from the min zoom to the max zoom or vice versa in ~20 mouse wheel clicks (right now the zoom is so slow it would probably take 1000).
  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2361 posts

    Posted 17 May 2019 Link to this post

    Hello Nate,

    To achieve your requirement you can disable the default zooming on mouse wheel and implement a custom one. Basically, you can get the scroll delta from the event arguments and calculate the new visible range. Then you can use the VisiblePeriodStart and VisiblePeriodEnd property of RadTimeline to manually zoom-in/out. 
    private void Timeline_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
    {
        e.Handled = true;
        // calculate the new visible range
        // set RadTimeline's  VisiblePeriod or VisiblePeriodStart and VisiblePeriodEnd properties
    }

    Regards,
    Martin Ivanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top