First I want to quickly explain the notion of zoom & pan offset. Image you have a chart. The chart has an actual width of 500. However, the left vertical axis has an actual width of 80 and the last tick of the horizontal axis is 20 pixels inside the chart. The 20 pixels are needed so that the last label is shown and is not clipped, and also it is centered relative to the last tick. This leaves 400 pixels for the plot area. This is what we call plot area width. You get this from the RadChart.PlotAreaClip.Width.
Now, when you zoom in (3, 1), naturally the virtual plot area would increase 3 times and if you want to show the middle part, you need to set an offset of (-400, 0). Now, when you check the PlotAreaClip - it still shows width 400, because this is the visible part of the plot area. So, to your question, all you need to do is shown in the code snippet below:
var plotAreaWidth = chart.PlotAreaClip.Width;
var virtualWidth = plotAreaWidth * e.NewValue;
var centerPanOffset = (virtualWidth - plotAreaWidth) / 2;
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>