commit 4fac2b2d643d67c8b1f43c746eb8fa333c52f946
parent d5f9d6e97f8779d04b20d63ae0139e38f9f5bcbd
Author: Chris Bracken <chris@bracken.jp>
Date: Sat, 13 Nov 2021 09:23:00 -0800
Bugfix: emit datapoints with timestamp
Previously we assumed that all sensors were collecting roughly similar
numbers of datapoints at roughly similar intervals. This is not a valid
assumption; some sensors may collect data more frequently than others;
some may be turned off for short periods, etc.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/static/tempestas.js b/static/tempestas.js
@@ -56,7 +56,7 @@ function updateChart(chart) {
for (let i = 0; i < sensors.length; i++) {
var sensorId = sensors[i].id;
data.datasets.push({
- data: sensorReadings[chart.id][sensorId].map(e => e.value),
+ data: sensorReadings[chart.id][sensorId].map(e => { return {x: Date.parse(e.time), y: e.value}; }),
label: sensors[i].name,
radius: 0,
borderWidth: 1,