Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Realtime Chart: QML or C++ ? need advice!
I want to plot a real time chart, and add some features to it like save the data, change scale, zoom and change colors, I have two options to follow either QML based like: https://doc.qt.io/qt-5/qtcharts-qmloscilloscope-example.html
or C++ based like: https://doc.qt.io/qt-5.11/qtcharts-dynamicspline-example.html
I am confused which one should I follow?
Don't use QtCharts at all for realtime, it is a bad idea. If you need to do it in QML, then I can say, that there are a bad news. You need to create an own implementation (based on QSGNodes) from scratch (AFAIK), or to use e.g. this.
But if you need in QtWidgets, then a best option (IMHO) - it is to use the Qwt library.
PS: QtCharts is ugly, slow, eats the memory, loads the CPU and etc. It can be used only for a static charts. I don't understand why it has been released at all (even worse under GPLv3). I'm personally don't recomment to use it, unfortuanelly.
Thanks for the advice
milan last edited by
@kuzulis yes I just test it also, and it looks not working, Can you have a look on it!
I did not tried qtquickplot. You can look on this blog. Or try to find another "charts library"... Or to create an own...
PS: I just pointed out that QtCharts is not a best choose. But I don't know other alternatives in QML.
ok thanks again @kuzulis
Gojir4 last edited by
Both C++ and QML solution are the same, QML is based on the C++ backend. So you can use the one which is best for you.
asterixxx last edited by