Fix power balance chart when there's returned energy but no producer

pull/979/head
Michael Zanetti 2023-02-22 17:40:58 +01:00
parent d93f817d87
commit 233c146a8c
1 changed files with 6 additions and 2 deletions

View File

@ -38,7 +38,7 @@ Item {
id: d
function formatValue(value) {
var ret
if (value >= 1000) {
if (Math.abs(value) >= 1000) {
ret = (value / 1000).toFixed(1) + "kW"
} else {
ret = value.toFixed(1) + "W"
@ -121,7 +121,11 @@ Item {
if (root.toGrid > 0) {
size = root.toGrid / biggest
if (producers.count > 0) {
drawDottedCurve(ctx, solarPos, gridPos, size, Style.yellow)
} else {
drawDottedCurve(ctx, consumptionPos, gridPos, size, Style.yellow)
}
}
if (energyManager.currentPowerProduction < 0 && root.fromProduction) {