QCustomPlot Discussion and Comments

Realtime QML plot slowing down after each trialReturn to overview

I am using qcustomplot in qml using qmlRegisterType. I have serial data that I collect and plot on one plot. I have three graphs on the same plot where each graph is being updated at 3000 samples per second - I am using it like a multi channel scope of sorts.

On the first run everything is great but things slow down if I dont call clearGraphs before each new trial. Now if I run my "scope" for 30 seconds then clearGraphs takes really long and I would like to know if there is a better way of accomplishing the same thing = fast plotting each time and not just the first.

Thanks

there is documentation on the site for increasing the speed of plotting. one thing you can do is not call setData and instead get the pointer and update the data directly (only adding one sample at a time instead of clearing).

Another thing you might do is instead of replotting every sample you get (3000x per second), you could just update it every 200ms or so... the user wont be able to tell the diference.

You could also use some threading and use a "pingpong"/multiples buffer. One buffer is use to get/save all your data, and during that time, you can clear the others not being use and swap them when you run another data acquisition...