Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.8.2
-
None
-
-
ca638618c (dev)
Description
If you create a simple bar graph and set the X axis with a QBarCategoryAxis instance, you can only exactly once set categories and get them to be updated on screen.
All later updates are ignored, thereby defying the entire point of using QMLs core idea of property bindings.
It aint a property if you can't change it...
Example code:
import QtQuick import QtQuick.Controls import QtGraphs Item { id: mainView width: 1280 height: 720 GraphsView { anchors.fill: parent axisX: BarCategoryAxis { id: categories categories: [ "1", "2", "3" ] gridVisible: false subGridVisible: false } axisY: ValueAxis { min: 20 max: 100 tickInterval: 10 subTickCount: 9 } BarSeries { BarSet { values: [ "70" ] } } } Button { text: "change" onClicked: { if (categories.categories[0] === "1") categories.categories = [ "foo", "bar"] else categories.categories = [ "1", "2", "3" ] } } }
I expect the updating of the property to have the effect of updating the values displayed.
Notice that I tried updating the GraphsView.axisX itself with a new instantiated QBarCategoryAxis instance, populated with new data. This also had no effect. So very likely the issue isn't directly in QBarCategoryAxis, it sounds likely to be in the GraphView framework.
I would rate this very high priority as static graphs are really not all too useful, being able to respond to data is definitely a requirement of basic functionality before you can release it.
The usecase here is to switch between historical graphs over different timespans. A week, a month etc. For that I need to have different values on the x axis.