These are chat archives for oxyplot/oxyplot

23rd
Apr 2016
CharlesMcBaker
@CharlesMcBaker
Apr 23 2016 17:32
Anyone online?
??
Thomas Ibel
@tibel
Apr 23 2016 17:39
@CharlesMcBaker Just write your request. (What would you do if I answer NO?)
CharlesMcBaker
@CharlesMcBaker
Apr 23 2016 18:48
    public void graph1()
    {
        model = new PlotModel { Title = "example" };
        model.LegendPosition = LegendPosition.RightBottom;
        model.LegendPlacement = LegendPlacement.Outside;
        model.LegendOrientation = LegendOrientation.Horizontal;

        model.Series.Add(GetFunction());
        var Yaxis = new OxyPlot.Axes.LinearAxis();
        OxyPlot.Axes.LinearAxis XAxis = new OxyPlot.Axes.LinearAxis { Position = OxyPlot.Axes.AxisPosition.Bottom, Minimum = 0, Maximum = 100 };
        XAxis.Title = "X";
        Yaxis.Title = "10 * x * x + 11 * x*y*y  + 12*x*y";
        model.Axes.Add(Yaxis);
        model.Axes.Add(XAxis);
        this.plot.Model = model;
    }
I'm getting errors @ model
"The name model" does not exist in the current context
i'm not really versed in C# or any language for that matter :P some help would be appreciated
Thomas Ibel
@tibel
Apr 23 2016 18:51
write a "var " in front of "model = PlotModel"
CharlesMcBaker
@CharlesMcBaker
Apr 23 2016 18:52
Weird tried that before but then it did not work
    public void graph1()
    {
        var model = new PlotModel { Title = "example" };
        model.LegendPosition = LegendPosition.RightBottom;
        model.LegendPlacement = LegendPlacement.Outside;
        model.LegendOrientation = LegendOrientation.Horizontal;

        model.Series.Add(GetFunction());
        var Yaxis = new OxyPlot.Axes.LinearAxis();
        OxyPlot.Axes.LinearAxis XAxis = new OxyPlot.Axes.LinearAxis { Position = OxyPlot.Axes.AxisPosition.Bottom, Minimum = 0, Maximum = 100 };
        XAxis.Title = "X";
        Yaxis.Title = "10 * x * x + 11 * x*y*y  + 12*x*y";
        model.Axes.Add(Yaxis);
        model.Axes.Add(XAxis);
        this.plot.Model = model;
    }
now i have an error @ the last line
Thomas Ibel
@tibel
Apr 23 2016 18:54
does your class have a member named "plot" of type "PlotView" ?
CharlesMcBaker
@CharlesMcBaker
Apr 23 2016 18:54
fixed it haha!
thanx! :)
forgot the to add the control :)
CharlesMcBaker
@CharlesMcBaker
Apr 23 2016 23:13
I want to plot a fuction
the function is as follows:
y = nl - ((nl/st)*x)
nl & st are integers