Limiting the zoom and restarting the axes

Jun 22, 2013 at 11:15 AM
Edited Jun 22, 2013 at 11:16 AM
Hello, I'm using OxyPlot for WPF and I can't find a way to reset the axes. I want to achieve the same effect as when you press the button "A" with the plot focused. I've seen in the source that ResetAxes is a public method but somehow I can't access to it.

My second question is how could I limit the zoomable area in code? I can't set it statically in XAML or in the initialization of the plot because my data will change and I want to limit the size depending on the data. Do I need to check before every PlotRefresh(true) my just added Series most extreme values and then use that values or is there something that already does that?

Thank you.
Jun 24, 2013 at 9:26 AM
for a project I had the same needs and I solved it by binding the AbsoluteMaximum and AbsoluteMinimum of the axes to a property which changes as per my needs (i.e. the date selected by the user) after this you can call ResetAxes in your code and the axes automatically zoom to your limits.
Hoping to be helpful!
Jun 24, 2013 at 10:23 AM
Edited Jun 24, 2013 at 10:24 AM
Thank you, I can't find that ResetAxes method!! I can create one very easily with this one:
private void AxReset()
But I wonder why I can't access that ResetAxes of yours! Maybe the version of OxyPlot? I'm using WPF but I only add
using OxyPlot;
using OxyPlot.Series;
using OxyPlot.Annotations;
using OxyPlot.Axes;
Because if I add OxyPlot.Wpf it interfere with others, very odd...
Jun 24, 2013 at 10:37 AM
Sorry! You're right, I did my ResetAxes method too, where the Axis reset part is something like:
foreach (var axis in Plot.Axes)