-
-
-
-
-
-
+
+
+
+
+
-
- {{b.name}}
- {{b.history[0].percentage * 100}}%
-
- {{round(b.history[0].temp)}} °C
-
- Charging: {{b.history[0].charging}}
-
diff --git a/src/app/battery/battery.service.ts b/src/app/battery/battery.service.ts
index b24c78c..c3d7959 100644
--- a/src/app/battery/battery.service.ts
+++ b/src/app/battery/battery.service.ts
@@ -20,10 +20,10 @@ export class BatteryService {
this.last = new Date();
let data = snap.data();
- this.batteries = Object.keys(data).map(key => ({name: key, history: data[key].reverse()}));
+ this.batteries = Object.keys(data).map(key => ({name: key, history: data[key]}));
this.average = this.batteries.reduce((acc, battery) => acc + battery.history[0].percentage, 0) / this.batteries.length;
- this.percentageData = this.batteries.map(battery => ({name: battery.name, value: battery.history[0].percentage * 100}));
- this.temperatureData = this.batteries.map(battery => ({name: battery.name, value: Math.round(battery.history[0].temp * 10) / 10}));
+ this.percentageData = this.batteries.map(battery => ({name: battery.name, series: battery.history.map((history, i) => ({name: i, value: history.percentage * 100}))}));
+ this.temperatureData = this.batteries.map(battery => ({name: battery.name, series: battery.history.map((history, i) => ({name: i, value: Math.round(history.temp * 10) / 10}))}));
});
}
diff --git a/src/styles.scss b/src/styles.scss
index 3e12b85..890406f 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -129,6 +129,14 @@ html, body {
flex-grow: 3;
}
+.flex-shrink-0 {
+ flex-shrink: 0;
+}
+
+.flex-shrink-1 {
+ flex-shrink: 1;
+}
+
.flex-basis-0 {
flex-basis: 0;
}