I am investigating the use of LiveChart within a WPF application for the purpose of plotting in real time, temperature measurements. I have put together a simple line chart example to read data at 10Hz, and redraw for every sample. However, I am finding that the redraw rate is around 1Hz. This seems very slow for a WPF Live charting tool. My xaml is as follows :
<lvc:CartesianChart x:Name="TemperatureChart" Grid.Row="1" LegendLocation="Right" Hoverable="False" DataTooltip="{x:Null}">
<lvc:CartesianChart.Series>
<lvc:LineSeries x:Name="TempDataSeries" Values="{Binding TemperatureData}"></lvc:LineSeries>
</lvc:CartesianChart.Series>
</lvc:CartesianChart>
And snippets from my view Model is as follows :
ChartValues<ObservableValue> _temperatureData = new ChartValues<ObservableValue>();
public ChartValues<ObservableValue> TemperatureData
{
get => this._temperatureData;
set => this._temperatureData = value;
}
void Initialise()
{
_temperatureMonitor.Subscribe(ProcessTemperatures);
}
void TestStart()
{
_temperatureMonitor.Start();
}
void TestStop()
{
_temperatureMonitor.Stop();
}
void ProcessTemperatures(TemperatureData data)
{
TemperatureData.Add(data.Temperature);
}
I am not working with a large amount of data, and have tested with a limit of 100 values. I am confident that my thread, which reads the data has little overhead, however the redraw plots around 10 points at a time.
Have I implemented the binding correctly? Do I need to add property notifications to force the update? My understanding was that this was handled by ChartValues.
Thanks.
Update. Oxyplot produced the desired results shown below by binding to an ObservableColllection of DataPoints. It would be nice to get the same performance using LiveCharts, as it has really nice aesthetics.

