diff --git a/nymea-app/ui/mainviews/dashboard/DashboardGraphDelegate.qml b/nymea-app/ui/mainviews/dashboard/DashboardGraphDelegate.qml index 554c3ca2..2364c5c7 100644 --- a/nymea-app/ui/mainviews/dashboard/DashboardGraphDelegate.qml +++ b/nymea-app/ui/mainviews/dashboard/DashboardGraphDelegate.qml @@ -62,7 +62,17 @@ DashboardDelegateBase { StateChart { id: graph - title: root.state && root.stateType ? root.thing.name + ", " + root.stateType.displayName + ": " + Types.toUiValue(root.state.value, root.stateType.unit).toFixed(0) + Types.toUiUnit(root.stateType.unit) : "" + title: { + if (!root.state || !root.stateType) { + return "" + } + + var ret = root.thing.name + ", " + root.stateType.displayName + if (["int", "uint", "double"].indexOf(root.stateType.type.toLowerCase()) >= 0) { + ret += ": " + Types.toUiValue(root.state.value, root.stateType.unit).toFixed(0) + Types.toUiUnit(root.stateType.unit) + } + return ret + } thing: root.thing color: root.thing ? app.interfaceToColor(root.thing.thingClass.interfaces[0]) : Style.accentColor