C# 使用Oxyplot Visual studio C的线图#

C# 使用Oxyplot Visual studio C的线图#,c#,oxyplot,C#,Oxyplot,我正在努力获得一个简单的线图作为输出。Oxyplot的所有工具不在我的工具栏中 InitializeComponent(); PlotModel model = new PlotModel(); OxyPlot.WindowsForms.PlotView plot1 = new OxyPlot.WindowsForms.PlotView(); var lineSeries = new LineSeries(); lineSeries.Points.Add(new DataPoint

我正在努力获得一个简单的线图作为输出。Oxyplot的所有工具不在我的工具栏中

InitializeComponent();
PlotModel model = new PlotModel();

OxyPlot.WindowsForms.PlotView plot1 = new OxyPlot.WindowsForms.PlotView();     

var lineSeries = new LineSeries();
lineSeries.Points.Add(new DataPoint(0, 0))
lineSeries.Points.Add(new DataPoint(10, 4));
lineSeries.Points.Add(new DataPoint(30, 2));
lineSeries.Points.Add(new DataPoint(40, 12));
model.Series.Add(lineSeries);
如何在Visual Studio的工具栏中使用Oxyplot命令?

如果使用WPF:

如果要在设计视图中添加打印控件,请按选择项。。。在工具箱中,浏览OxyPlot.Wpf.dll文件。如果使用NuGet,它应该位于解决方案文件夹中的packages文件夹中

遇到同样的问题并最终找到了解决方案(针对WPF): (可能同样适用于WinForms)


  • 在项目树中的“./packages”中的某个位置找到OxyPlot dll,并将OxyPlot.dll和OxyPlot.Wpf.dll复制到相同的文件夹中 文件夹(例如“./packages/OxyPlot\u Wpf”)

  • 然后,在解决方案资源管理器中,删除NuGet所包含的引用 以前创建,并改为添加对复制的DLL的引用

  • 最后,在工具箱中创建一个新选项卡并拖动OxyPlot.Wpf.dll 从文件资源管理器中,将其放到“创建”选项卡上


  • 您现在应该看到大约三十多个OxyPlot控件

    答案为我指明了正确的方向

    干杯,
    Al

    请澄清您的问题。我在visual Studio的工具箱中找不到任何oxyplot组件。这是WPF吗?什么平台?域已死亡,链接将指向错误内容,请修复或删除。