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