QCustomPlot Discussion and Comments

improving replotting?Return to overview

Hello all together!
I have to plot realtime data and I am very happy with QCP. However, I have a small "problem":
My whole replotting takes about 20-30ms/graph and I have 4 graphs max, so 120ms max for the replot procedure, including addData etc. With the use of timers I found that most of the time is taken by replot().
My problem is everytime I replot, I cannot save the realtimedata to be replottet, resulting in holes in the plot.
I was thinking about replotting in a different thread and got stuck - found out at the end of the day that replot can only be called in the GUI-thread.

So my original question is:
Is there a possibility to improve / outsorce the replot?
Of course I have thought about putting the data aquirisation in a different thread, but that qould be a bit more complex I guess, so I wanted to start with the QCP end.

Thank you in advance! :)

the way we do our code is we acquire the data on other threads and then update our plot only once every 200-500ms.

Thanks.
The plot gets updated every 5sec (yeah, quite some time), but I'll try and aquire the data on a different thread :)

can we replot only some portion of a graph instead of the whole graph..? if yes please comment the code..

Hi subrat,

What do you mean by that? Replotting only the new data would be a big plus, as I have some high frequency sine waves, which take quite some time to be plotted. Plotting only the new 5sec of Sine waves would be a great improvement!