I am new to WPF and the project I'm working on requires me to plot a list of double on XY chart. I added Oxyplot to my project for the charting but I'm having challenges to get a plot.
I followed the example on Oxyplot site (see code below), but I discovered that the DataPoint can only accept double values of x and y not array or list of doubles.
How can I plot List<double>
for XValues and List<double>
for YValues?
namespace WpfApplication2
{
using System.Collections.Generic;
using OxyPlot;
public class MainViewModel
{
public MainViewModel()
{
this.Title = "Example 2";
this.Points = new List<DataPoint>
{
new DataPoint(0, 4),
new DataPoint(10, 13),
new DataPoint(20, 15),
new DataPoint(30, 16),
new DataPoint(40, 12),
new DataPoint(50, 12)
};
}
public string Title { get; private set; }
public IList<DataPoint> Points { get; private set; }
}
}