Oxyplot / WinForms ignores axes definition

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

user78483 wrote at 2013-10-18 00:04:

I do have a question about using Oxyplot in WinForms. The following code should add certain axes to the plot but it does not. If I do not specify Minimum/Maximum for both, it does nothing. If I specify both, the x-axis shows the right ones but the y-axis is wrong. Am I doing something wrong?
pm = new PlotModel("Trigonometric functions", "Example using the FunctionSeries")
   {
      PlotType = PlotType.Cartesian,
      Background = OxyColors.White,
    };
pm.Axes.Add(new LinearAxis(AxisPosition.Bottom, 0) { MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot, Title = "time",Minimum=0, Maximum=15 });
pm.Axes.Add(new LinearAxis(AxisPosition.Left, 1) { MajorGridlineStyle = LineStyle.Solid, MinorGridlineStyle = LineStyle.Dot, Title = "Values", Minimum = 0, Maximum = 10 });

pm.Series.Add(lineSeries1);
plot1.Model = pm;

panel1.Controls.Add(plot1);
Also changing the minimum and maximum values later on does not do anything.
lineSeries1.Points=this.points;
this.pm.Axes[0].Maximum = this.points.Last().X;
this.pm.Axes[0].Minimum = this.points.Last().X-3000;
this.pm.RefreshPlot(true);
Please help.