From 8ff9a4e9e409939c58cf0e7beee34b6b1e9c45a6 Mon Sep 17 00:00:00 2001 From: sietse jonker Date: Mon, 1 Apr 2024 13:19:00 +0200 Subject: [PATCH] Fix updateGraph() method in DataProcessor class --- web/newWebsite/graph-classes.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/web/newWebsite/graph-classes.js b/web/newWebsite/graph-classes.js index 3e6e359..1889e51 100644 --- a/web/newWebsite/graph-classes.js +++ b/web/newWebsite/graph-classes.js @@ -67,7 +67,7 @@ class Graph { x: [this.timeArray], y: [this.tempArray, this.humiArray, this.eco2Array, this.tvocArray], }; - + Plotly.update(this.id, update); } } @@ -140,10 +140,12 @@ class DataProcessor { } updateGraph() { - for (let i = 0; i < this.data.length; i++) { - this.graph.updateData(this.data[i].Type, this.data[i].Value, this.data[i].TimeStamp); - console.log(this.data[i].Type, this.data[i].Value, this.data[i].TimeStamp); - this.graph.updateGraph(); + for (let i = 0; i < this.data.length; i + 3) { + for (let i = 0; i < 4; i++) { + this.graph.updateData(this.data[i].Type, this.data[i].Value, this.data[i].TimeStamp); + console.log(this.data[i].Type, this.data[i].Value, this.data[i].TimeStamp); + this.graph.updateGraph(); + } } } }