Changed endpoints and db queries, chart now shows suggested mins and maxes
This commit is contained in:
@@ -129,7 +129,8 @@
|
||||
setInterval(async () => {
|
||||
const newDatum = await fetch("/" + ROOT_URL + "data/last/");
|
||||
const snapshot = (await newDatum.json()).snapshots[0];
|
||||
if (snapshot.time !== chart.data.datasets[0].x) {
|
||||
const latestTime = chart.data.datasets[0].data[chart.data.datasets[0].data - 1].x;
|
||||
if (snapshot.time !== latestTime) {
|
||||
removeExpiredData(chart, snapshot.time);
|
||||
insertSnapshot(chart, snapshot);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user