Fix a crash in the charts when adding/removing things
This commit is contained in:
parent
c5c404f369
commit
c3dbdb67d8
@ -76,6 +76,7 @@ ThingPageBase {
|
|||||||
Layout.margins: Style.bigMargins
|
Layout.margins: Style.bigMargins
|
||||||
size: Style.largeIconSize
|
size: Style.largeIconSize
|
||||||
imageSource: "thermostat/heating"
|
imageSource: "thermostat/heating"
|
||||||
|
color: Style.white
|
||||||
backgroundColor: app.interfaceToColor("heating")
|
backgroundColor: app.interfaceToColor("heating")
|
||||||
visible: root.boostState
|
visible: root.boostState
|
||||||
busy: actionQueue.pendingValue ? actionQueue.pendingValue : (root.boostState && root.boostState.value === true)
|
busy: actionQueue.pendingValue ? actionQueue.pendingValue : (root.boostState && root.boostState.value === true)
|
||||||
|
|||||||
@ -186,7 +186,7 @@ MainViewBase {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width - app.margins * 2
|
width: parent.width - app.margins * 2
|
||||||
visible: !engine.thingManager.fetchingData && (!engine.jsonRpcClient.experiences.hasOwnProperty("Energy") || engine.jsonRpcClient.experiences["Energy"] <= "0.1")
|
visible: !engine.thingManager.fetchingData && (!engine.jsonRpcClient.experiences.hasOwnProperty("Energy") || engine.jsonRpcClient.experiences["Energy"] <= "0.1")
|
||||||
title: qsTr("Energy plugin not installed installed.")
|
title: qsTr("Energy plugin not installed.")
|
||||||
text: qsTr("This %1 system does not have the energy extensions installed.").arg(Configuration.systemName)
|
text: qsTr("This %1 system does not have the energy extensions installed.").arg(Configuration.systemName)
|
||||||
imageSource: "../images/smartmeter.svg"
|
imageSource: "../images/smartmeter.svg"
|
||||||
buttonText: qsTr("Install energy plugin")
|
buttonText: qsTr("Install energy plugin")
|
||||||
|
|||||||
@ -56,7 +56,10 @@ ChartView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateConsumers() {
|
function updateConsumers() {
|
||||||
|
root.animationOptions = ChartView.NoAnimation
|
||||||
|
print("clearing consumers pie chart", consumersBalanceSeries.count)
|
||||||
consumersBalanceSeries.clear();
|
consumersBalanceSeries.clear();
|
||||||
|
print("cleared consumers pie chart")
|
||||||
|
|
||||||
if (engine.thingManager.fetchingData) {
|
if (engine.thingManager.fetchingData) {
|
||||||
return;
|
return;
|
||||||
@ -81,6 +84,10 @@ ChartView {
|
|||||||
d.unknownSlice.color = Style.gray
|
d.unknownSlice.color = Style.gray
|
||||||
|
|
||||||
d.thingsColorMap = colorMap
|
d.thingsColorMap = colorMap
|
||||||
|
|
||||||
|
root.animationOptions = Qt.binding(function() {
|
||||||
|
return Qt.application.active ? NymeaUtils.chartsAnimationOptions : ChartView.NoAnimation
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
PieSeries {
|
PieSeries {
|
||||||
|
|||||||
Reference in New Issue
Block a user