From 556146a415f973687d1564a79bcd4e88b1ca86f3 Mon Sep 17 00:00:00 2001 From: Zak Timson Date: Thu, 20 Dec 2018 18:56:00 -0500 Subject: [PATCH] Fixed temperature graph --- src/app/battery/battery.component.html | 2 +- src/app/battery/battery.service.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/battery/battery.component.html b/src/app/battery/battery.component.html index c77d88e..10afefd 100644 --- a/src/app/battery/battery.component.html +++ b/src/app/battery/battery.component.html @@ -7,7 +7,7 @@
({name: key, history: data.modules[key]})); this.average = this.batteries.reduce((acc, battery) => acc + battery.history[0].charge, 0) / this.batteries.length; - this.percentageData = this.batteries.map(battery => ({name: battery.name, series: battery.history.map((history, i) => ({name: i, value: history.charge}))})); - this.temperatureData = this.batteries.map(battery => ({name: battery.name, series: battery.history.map((history, i) => ({name: i, value: Math.round(history.temp * 10) / 10}))})); + this.chargeData = this.batteries.map(battery => ({name: battery.name, series: battery.history.map((history, i) => ({name: i, value: history.charge}))})); + this.temperatureData = this.batteries.map(battery => ({name: battery.name, series: battery.history.map((history, i) => ({name: i, value: Math.round((history.temp || 0) * 10) / 10}))})); }); } }