Make dynamic graph
-
Hey there, I need to make dynamic graph using qt or qml, so please suggest me what should I use either QT or QML and please suggest me library also.
-
Hi,
since Qt 5.7, I would suggest Qt Charts it was previously commercial-only, but is now included in Qt under GPLv3 license for open source users.
Besides that, QCustomPlot is popular.
Both are cpp suggestions as I'm not yet really familiar with QML and the options you have there :).
-
I can highly recommend QCustomPlot as its easy to get going with.
-
@Raghvendra said in Make dynamic graph:
chartview.
Ahh, yes. That should also be very easy to get going :)
-
@mrjj I am not finding any way to insert data dynamically
LineSeries {
visible:tempVisibilty
id:temperature
name: "Temperature"
XYPoint { x: 0; y: 0 }
XYPoint { x: 1.1; y: 2.1 }
XYPoint { x: 1.9; y: 3.3 }
XYPoint { x: 2.1; y: 2.1 }
XYPoint { x: 2.9; y: 4.9 }
XYPoint { x: 3.4; y: 3.0 }
XYPoint { x: 4.1; y: 3.3 }}
like here the number of XYPoint is fixed but i need to send it dynamically and update my graph as well
-
@Raghvendra said in Make dynamic graph:
Hi
Sadly im not into QML so i do not know directly
but
http://doc.qt.io/qt-5/qtcharts-qmloscilloscope-example.html
seems very dynamic?I think you will need c++ for it but not sure.
Give it some time, maybe others know easy way.
-
@Raghvendra My standard answer to this question:
create a
QStandardItemModel
in C++ and expose it to qml, use a model mapper for the chart (for example VXYModelMapper) and now you can change the contents of the model dynamically and the changes will be reflected in the chart -
Can you give me an example for implement QStandardItemModel with qml graph or something like this