Last active
December 14, 2015 22:49
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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