QCustomPlot Discussion and Comments

slow plotting on android, using qt 5.9.2 and QMLReturn to overview

I wrote an app to plot measurement data. I have 5 plots on an qml gui. i am plotting ~16384 data points on all plots.

my problem is that all works very nice on windows computer, but plotting is very slow on android (quad core Cortex A9 @ 1GHz) it takes about 500ms for 1 plot to be plotted.

pen width is 1, setData (...) is used, but all data points change every time the plot is replotted.

replot (...) is used to replot the graphs.

thanks for any help

now i activated opengl, but this did not bring a big performance win. additionally the plots look blurred (with/without opengl active) while on windows desktop they look OK.

there are a bunch of optimizations you can do... i think there is a link to the page somewhere on the site. through my own experience, i have noticed some slowdowns on calculating the bounds of the data before redrawing. if you reimplement getKeyRange and getValueRange, it can be sped up a little.

@MWI you are probably missing something important in your QCustomPlot port to qml. Because I'm running plots with more data points and I can do panning at about 10-20fps and pinch zoom with even better performance on android in qml. You would have to post your QCustomPlot port to qml code to tell where the problem lies.

i am using the qmlplot example code. i think that the problem more or less is a cyclic repainting of the plot. using a older version of customplot i called replot () once my data was updated. for testing i replaced that with repaint (...) and afterwards even removed every manual call to replot (...) or repaint (...). to my surprise the plots are still successfully updated with much better performance now.

I do not fully understand at which point the QML GUI updates the plots now, but plotting speed is now OK for me.

Thanks for all the comments.

Qmlplot is slow.
If you look at the implementation of paint you will see that there is additional painting to pixmap and then drawing that paintmap.
To get better performance draw mPaintBuffers directly in reimplemented paint method of QQuickPaintedItem