Skip to content

Instantly share code, notes, and snippets.

@BartDM
Last active December 14, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BartDM/5161613 to your computer and use it in GitHub Desktop.
Save BartDM/5161613 to your computer and use it in GitHub Desktop.
Code samples of blog post Creating graphs in WPF using OxyPlot on http://blog.bartdemeyer.be
private void LoadData()
{
List<Measurement> measurements = Data.GetData();
var dataPerDetector = measurements.GroupBy(m => m.DetectorId).ToList();
foreach (var data in dataPerDetector)
{
var lineSerie = new LineSeries
{
StrokeThickness = 2,
MarkerSize = 3,
MarkerStroke = colors[data.Key],
MarkerType = markerTypes[data.Key],
CanTrackerInterpolatePoints = false,
Title = string.Format("Detector {0}",data.Key),
Smooth = false,
};
data.ToList().ForEach(d=>lineSerie.Points.Add(new DataPoint(DateTimeAxis.ToDouble(d.DateTime),d.Value)));
PlotModel.Series.Add(lineSerie);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment