Almost there

This commit is contained in:
Daniel Ledda
2020-11-14 16:23:30 +01:00
parent 14d32d7306
commit b8a3dc1c38
3 changed files with 5 additions and 5 deletions

View File

@@ -19,7 +19,7 @@ func main() {
panic(err) panic(err)
} }
quitSnapshot := make(chan int, 1) quitSnapshot := make(chan int, 1)
go saveSnapshotOnInterval(1, quitSnapshot) go saveSnapshotOnInterval(30, quitSnapshot)
startServer() startServer()
} }

2
webapp/dist/main.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -106,9 +106,9 @@ class ClimateChart {
private insertSnapshots(...snapshots: Snapshot[]) { private insertSnapshots(...snapshots: Snapshot[]) {
for (const snapshot of snapshots) { for (const snapshot of snapshots) {
this.chart.data.datasets[0].data.push(snapshot.humidity); this.chart.data.datasets[0].data.push({x: snapshot.time, y: snapshot.humidity});
this.chart.data.datasets[1].data.push(snapshot.temp); this.chart.data.datasets[1].data.push({x: snapshot.time, y: snapshot.temp});
this.chart.data.datasets[2].data.push(snapshot.co2); this.chart.data.datasets[2].data.push({x: snapshot.time, y: snapshot.co2});
} }
} }