Created
March 14, 2013 14:43
-
-
Save BartDM/5161897 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
public void UpdateModel() | |
{ | |
List<Measurement> measurements = Data.GetUpdateData(lastUpdate); | |
var dataPerDetector = measurements.GroupBy(m => m.DetectorId).OrderBy(m => m.Key).ToList(); | |
foreach (var data in dataPerDetector) | |
{ | |
var lineSerie = PlotModel.Series[data.Key] as LineSeries; | |
if (lineSerie != null) | |
{ | |
data.ToList() | |
.ForEach(d => lineSerie.Points.Add(new DataPoint(DateTimeAxis.ToDouble(d.DateTime), d.Value))); | |
} | |
} | |
lastUpdate = DateTime.Now; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment