0

I'm trying to learnt how to use Oxyplot with WindowsForm, so I just created a WindorsForm and copy the example in Oxyplot guide(https://readthedocs.org/projects/oxyplot/downloads/pdf/latest/) in page 23. So, this is my code

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using DocumentFormat.OpenXml.Bibliography;


namespace JuliaForms {
    using System;
    using System.Windows.Forms; 
    using OxyPlot; 
    using OxyPlot.Series;
    
    public partial class Form1 : Form
    { 
        public Form1() 
        { 
            this.InitializeComponent(); 
            var myModel = new PlotModel { Title = "Example 1" };
            myModel.Series.Add(new FunctionSeries(Math.Cos, 0, 10, 0.1, "cos(x)")); 
            this.plot1.Model = myModel; 
        } 
    } 
} 

It return me an error, saying that I left a reference or a method. But I have all references and according to the guide I dont need any method. So, could somebody tell me how could I fix the error? Thanks in advance

Palle Due
  • 5,929
  • 4
  • 17
  • 32
  • I assume that plot1 is of type PlotView? I have created a new Windows Forms project with only one form containing a PlotView and inserted the four lines from your constructor into mine and it is running out of the box. Which version of OxyPlot do you use? I am using version 2.0.0. – Döharrrck Nov 15 '20 at 16:18
  • I Doharrrck, I'm using version 2.1.0. I think that it was a mistake in the guide, because I can do another examples. But, tank you for your time! – Antonio Manuel Mancera Hevilla Nov 15 '20 at 19:51

0 Answers0