So far, from what I've seen on the OxyPlot
documentation, not much is out there. How do I take x-y points and graph them using OxyPlot?
Here is my attempt at taking two points and graphing them:
var dataModel = new PlotModel { Title = "data plot" };
foreach (var pt in dataProfile)
{
XYData.Text = String.Format("X:{0} Y:{1}", pt.X,pt.Y);
dataModel.Series.Add(pt.X, pt.Y); //(obviously wrong here)
this.plot1.Model = dataModel;
}
What do I need to change/add to: dataModel.Series.Add(pt.X, pt.Y);
, so that it adds points? Additionally, how can I plot points over time? (x-y, plotted as time t passes by)
Does anyone know of a good OxyPlot tutorial site (for WinForms), because I cannot find one (apart from the OxyPlot documentation, which is very broad at best).
I know you've mentioned
WinForms
, but you must be able to get comfortable with looking at all of the examples and all of the source code, regardless of the UI framework being used. Look up oxyplot in your favorite search engine and you'll find plenty of examples on their GitHub page (or whatever repo service they'll use whenever this answer is being looked at).Anyways, what you want is a
ScattierSeries
plot. You then add points to it. An example:There are a ton of examples under the example browser link I gave you. The above code was snipped from there. So, research all of the available options. OxyPlot is very flexible and I've been able to extend on it easily in my recent project.