private async void DisplayHrData() { var myList = new List<HrModel>(); for (var i = 0; i < 100; i++) { var hr = new HrModel { Time = i }; if (HrCollection.Count > i) hr.HeartRate = HrCollection[i].HeartRate; } await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { _lineSeries = LineChart.Series[0] as LineSeries; if (_lineSeries != null) _lineSeries.ItemsSource = myList; }); }
private void GenerateSampleData() { var rnd = new Random(); var myList = new List<HrModel>(); var hr = new HrModel { Time = 0, HeartRate = 65 }; myList.Add(hr); for (var i = 1; i < 100; i++) { hr = new HrModel { Time = i, HeartRate = 70 + rnd.Next(5) }; myList.Add(hr); } hr = new HrModel { Time = 0, HeartRate = 90 }; myList.Add(hr); _lineSeries = LineChart.Series[0] as LineSeries; if (_lineSeries != null) _lineSeries.ItemsSource = myList; }