I am trying to create a light-as-possible real-time plotter with Live Charts Geared WPF, sampling roughly 125 points a second. Adding point-by-point regularly works just fine, except that CPU utilization is much too high.
I would like to draw several points at once, reading in values from a buffer, similar to the website example:
var temporalCv = new double[1000];
for (var i = 0; i < 1000; i++){
temporalCv[i] = 5;
}
var cv = new ChartValues<double>();
cv.AddRange(temporalCv);
By itself, the example does not throw any issues.
However, it throws a cannot convert from double[]
to Systems.Collections.Generic.IEnumerable<Object>
when I want to AddRange
to ChartValues
and GearedValues
below.
SeriesCollection = new SeriesCollection
{
new GLineSeries
{
Title = "Pressure",
Values = new GearedValues<double> {},
},
new LineSeries
{
Title = "Pulse",
Values = new ChartValues<double> { },
}
};
SeriesCollection[1].Values.AddRange(temporalCv);
I have also tried changing the array to a GearedValue<double>
type but it will still throw the issue when I want to add double values to the array.
Is there anyway to convert double[]
or another way to add multiple points to the plot together without erasing old points?