I have a LineChart that uses the FastLineBitmapSeries and is updated with new data every 5 seconds. My question is how do I stop the axis from being scaled for the new data when the user has the graph zoomed into a specific point. Currently if the user zooms in and new data is added to the chart then the desired zoom position changes even though the ZoomFactor and ZoomPosition have not changed. I want the axis to stay at its current scaling when zoomed so that the zoomed point does not move off the screen as new data is added.
I took the example from the previous reply and changed some things. I wanted to throw these changes out to see if anyone thinks this is good or not. It seems to be working but I'm still testing . The LimitAxisZoom call just limits the value to 0 and 1. Is this needed, or will the ZoomFactor and ZoomPosition automatically limit to 0 and 1?
Ok, I don't think changing the ZoomFactor or ZoomPosition within the Axis_ActualRangeChanged event is working very well.
I do have one request for a possible improvement. That request would be to add the last ActualMinimum and last ActualMaximum to the ActualRangeChangedEventArgs class. These would be the values that they were before the range changed.
All in all this is what I ended up with:
if (_lastNumericalAxis != null && _graph.SecondaryAxis.ZoomFactor < 1.0)
// Determine the range of the last axis and calculate the new visible minimum and maximum values
Double range = (Double)_lastNumericalAxis.ActualMaximum - (Double)_lastNumericalAxis.ActualMinimum;
SSSuresh S Syncfusion Team September 25, 2014 04:14 AM UTC
Sorry for the inconvenience caused.
Axis default ZoomPosition will be 0 and ZoomFactor is 1. Whenever chart zooming happens their limit will be changed between 0 to 1.
We have analysed your previous code snippet, we have acheived your requirement axis being scaled when adding new data. Also, we have prepared the sample based on your requirement. Please download it from the given below location.
Please let us know if you request further assistance on this.