Some of the error messages disappeared after fully qualifying to use OxyPlot.Series.LineSeries (instead of OxyPlot.Wpf.LineSeries)
If we have to use OxyPlot.* objects over OxyPlot.Wpf.* (LineSeries, LinearAxes, AxesPosition) then how are we using oxyplot WPF classes for WPF application?
Can't find 'Points' method on OxyPlot.Wpf.LineSeries object.
OxyPlot.PlotModel temp = new PlotModel("Square wave");
OxyPlot.Series.LineSeries ls = new OxyPlot.Series.LineSeries("sin(x)+sin(3x)/3+sin(5x)/5+...");
int n = 10;
for (double x = -10; x < 10; x += 0.0001)
{
double y = 0;
for (int i = 0; i < n; i++)
{
int j = i * 2 + 1;
y += Math.Sin(j * x) / j;
}
ls.Points.Add(new DataPoint(x, y));
}
temp.Series.Add(ls);
temp.Axes.Add(new OxyPlot.Axes.LinearAxis(OxyPlot.Axes.AxisPosition.Left, -4, 4));
temp.Axes.Add(new OxyPlot.Axes.LinearAxis(OxyPlot.Axes.AxisPosition.Bottom));
MyPlotModel = temp; // this is raising the INotifyPropertyChanged event
Also, get the error:
The name 'MyPlotModel' does not exist in the current context
Thanks,
-srinivas y.
↧