ScottPlot is used to display a real time chart with 10'000+ data points.
Datapoints are added every seconds, so the chart needs to be updated.
A timer perform the refresh every seconds, however, it freezes the whole UI for a few ms, which is annying.
ScottPlot does have a Chart.RenderRequest();
method which is non-blocking, but the chart is still rendered on the UI thread so that does not solve the issue.
And of course, if we try to refresh it from a background worker, a thread exception happens.
var bg = new BackgroundWorker();
bg.DoWork += (s, e) =>
{
Chart.RenderRequest();
};
bg.RunWorkerAsync();
Is there any ways to render the chart in a separate thread with WPF and ScottPlot ?
Edit:
Did timing analysis, Refresh, Render, RefreshRequest, RenderRequest all have similar execution time, despite the "request" are supposedly non-blocking.