diff --git a/charts.html b/charts.html index 476bcc0..3b5e922 100644 --- a/charts.html +++ b/charts.html @@ -112,7 +112,8 @@ const humidity = []; const co2 = []; const temp = []; - for (const snapshot of json.snapshots) { + for (let i = 0; i < json.snapshots.length; i++) { + const snapshot = json.snapshots[json.snapshots.length - i - 1]; co2.push({x: snapshot.time, y: snapshot.co2}); temp.push({x: snapshot.time, y: snapshot.temp}); humidity.push({x: snapshot.time, y: snapshot.humidity}); @@ -135,4 +136,4 @@ - \ No newline at end of file +