I have a problem with OxyPlot which is as follows:
I create a new PlotView and attach a PlotModel with some axes when my program starts.
In my program, the user can open a file, which is interpreted and plotted in the PlotView control.
To display the new Series, I do
myPlotView.Invalidate(true);
This will display the data on in the plot, however OxyPlot does not perform any zooming. How can I pan and zoom automatically, such that the plot covers the whole PlotView?
I tried to set
myPlotView.Model.Axes[0].DataMinimum = someValue1
myPlotView.Model.Axes[1].DataMinimum = someValue2
myPlotView.Model.Axes[0].DataMaximum = someValue3
myPlotView.Model.Axes[1].DataMaximum = someValue4
but nothing happens.
Axes calculates the
ViewMinimumandViewMaxium(the real thing you are watching) only if Minimum and Maximum are not specified, you can set them toDouble.NaNbefore resetting, so the ViewMinimum and ViewMaximum will be calculated based onDataMinimumandDataMaximumAlso if you changed the data points, you must call to
Plot.InvalidatePlot()so theDataMinimumandDataMaximumgets updated too.