We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Zoom and Pan | Visible Range - Branched from forum 179819

Hello Nanthini, thank you very much for your response, unfortunately I could not get the behaviour I wanted working.

I have since switched over to a WPF application and to using SFChart.   I'd like to focus in on the zooming behaviour with some additional observations and screenshots, but I understand this forum is for WinForms in particular.  Please let me know if you would like me to create a new query in the WPF forum.

The behaviour objectives:

  1. When zooming on the X Axis, the most recent data must remain in view.
  2. When panning, removing most recent data from view, new zoom will consider the most recent visible data point as the anchor for zooming.
  3. When zoom in complete, the visible data should autoscale on the Y Axis - making the data clearer and properly scaled.
I have attempted a number of methods to acheive point 1.  The screenshot below shows the most recent where I attempt to override the the X Axis Minimum and Maximum values.  This does not work.

In the next 2 screenshots I have commented out the ZoomChanged event handler code.

Screenshot 1 shows a view of all data.  Screenshot 2 shows the data from a single forward roll of the mousewheel.
After the zoom, I can pan all the way to the oldest data, but I cannot pan to the newest data - The zoom chops off over a years worth of data.

Screenshot 1

Screenshot 2