Unsolved QChartView update problem
-
Hello,
I'm trying to connect QAbstractItemModel to QChartView.
I used the official example: https://doc.qt.io/qt-5/qtcharts-modeldata-example.htmlThe problem is that the chart does not update when adding a new row to the model.
I have tried different ways but without success.Can you please advise on how to do this?
P.S.:
I found a similar problem here on the forum but nobody solved it:
https://forum.qt.io/topic/73216/qvxymodelmapper-does-not-update-chart-x-axis -
Hi,
Can you show how you are adding data to the model ?
Also, what version of Qt are you using ?
On what platform ? -
Hi,
Is it that the chart doesn't update or are your not adjusting your axis to have a range where the new data falls into?
Creating the default axis will provide a range to the axis that fits the data. However the axis range will not change, so if your new data is outside of that range it will appear to not be updating.