0

WPF C# problems with minimum and maximum -> axis reset

Aleš Brelih 4 jaar geleden in Documentation 0
Hi.

I have a problem with setting minimum and maximum of a specific axis.

So the problem is with this. I have a chart that displays "something". On this chart are also timestamps where important stuff happened which are also listed in some datagrid on the right.
Functionality that i want to have is that when you click on a timestamp in the datagrid chart current view moves you to the location of that timestamp (zoomed).

Now first problems came when i tried changing min and max of an axis to the specific two points i wanted to display. It didn't want to work properly untill i called .Reset() function on the the axes before i tried to change minimum and maximum (and yes i did use PlotModel.InvalidatePlot(true)). Now when i tried to use the default double middle mouse button click to reset the view to the default it just doesn't do anything. If i dont call the .Reset() function, it resets properly.

Now the questions: What am i missing. Is just setting .Minimum and .Maximum a correct way to handle what i want to achieve. And how to i set the limits I want the chart to reset to (with implemented reset) after axis is reset.


Best regards and thanks for the help