Update Spline series Chart data Continuously using VXYmodelMapper in QML
-
I am using Qt chart module in QML.
I set the model data directly by the following code.
VXYModelMapper{
id:mapper
model: customtablemodel
series: lineone
xColumn: 0
yColumn: 1
Component.onCompleted:
{
console.log("loaded VXYModelMapper: xColumn " + mapper.xColumn + " yColumn " + mapper.yColumn)
}
}I need to update the model data every 5 sec and in C++ and update the graph.
Please let me know any work around for this.
Thanks in advance
-
https://forum.qt.io/topic/85621/qml-lineseries-with-c-vector-data/1
It can handle very fast updates, we're talking whole series replacements in 14ms (maybe less - 14ms is way too small for me to care to tighten further) using OpenGL series and replace() calls ... I think 5s is easy to achieve - it won't be charts / QXYSeries holding you back anyhow.
-
Actually i am using QAbstractTableModel to send the model data from c++ to QML. Also column number is mentioned in the VXYModelMapper. First time the chart is updated. How can i update model data from c++ to QML every 5 sec to change the charts continuously. The data is get from the data base table.
Please let me know