我在NuGet的OxyPlot库从1.x版迁移到2.1版时遇到了找不到Plot错误。发现Plot
类被移动到其他类库
在NuGet中下载OxyPlot.Contrib.Wpf库,Xaml代码见下:
引用:xmlns:oxy="http://oxyplot.org/wpf"
xmlns:oxycontrols="http://oxyplot.org/wpf/contrib"
将代码由:
<oxy
:Plot>
<oxy
:Plot.Axes>
<oxy
:LinearAxis />
<oxy
:LinearAxis />
</oxy
:Plot.Axes>
<oxy
:LineSeries ItemsSource="{Binding PointList}"/>
</oxy
:Plot>
改为:
<oxycontrols
:Plot>
<oxycontrols
:Plot.Axes>
<oxycontrols
:LinearAxis />
<oxycontrols
:LinearAxis />
</oxycontrols
:Plot.Axes>
<oxycontrols
:LineSeries ItemsSource="{Binding PointList}"/>
</oxycontrols
:Plot>