No chart legend on the graphic plot

37 Views Asked by At

I have write a little program to begin to test Oxyplot. I have a windows form with a plot view and the standard "cos" function. Everything is ok except the fact that there is no "cos(x)" legend! Here is my code: `

   private void button1_Click(object sender, EventArgs e)
    {
        Equatorial equ_2000 = Astronomy.Equator(corps, time, observateur, EquatorEpoch.J2000, Aberration.Corrected);
        Equatorial equ_ofdate = Astronomy.Equator(corps, time, observateur, EquatorEpoch.OfDate, Aberration.Corrected);
        Topocentric hor = Astronomy.Horizon(time, observateur, equ_ofdate.ra, equ_ofdate.dec, Refraction.Normal);
        labelHauteur.Text = hor.altitude.ToString("0.##");
        labelAzimuth.Text = hor.azimuth.ToString("0.##");
        var myModel = new PlotModel { Title = "Example 1" };
        myModel.Series.Add(new FunctionSeries(Math.Cos, 0, 10, 0.1, "cos(x)"));
        plotView.Model = myModel;
    }

` Thanks for your help Michel

0

There are 0 best solutions below