diff --git a/web/newWebsite/graph-classes.js b/web/newWebsite/graph-classes.js index 491ecae..a432a36 100644 --- a/web/newWebsite/graph-classes.js +++ b/web/newWebsite/graph-classes.js @@ -8,11 +8,16 @@ class Graph { this.tvocArray = []; } + createDiv() { + let div = document.createElement("div"); + let graphDiv = document.createElement("div"); + div.setAttribute("class", "graphBody"); + graphDiv.setAttribute("id", this.id); + div.appendChild(graphDiv); + document.body.appendChild(div); + } // Function to create a graph makeGraph(line, lineColor, name) { - let div = document.createElement("div"); - div.setAttribute("id", this.id); - document.graphBody.appendChild(div); let lineArray; switch (line) { case "temp": @@ -132,6 +137,7 @@ class DataProcessor { makeGraph() { this.graph = new Graph(1); + this.graph.createDiv(); this.graph.makeGraph("temp", "red", "Temperature"); this.graph.makeGraph("humi", "blue", "Humidity"); this.graph.makeGraph("eco2", "green", "eCO2"); diff --git a/web/newWebsite/graphs.html b/web/newWebsite/graphs.html index 18f4f4e..d4b62cc 100644 --- a/web/newWebsite/graphs.html +++ b/web/newWebsite/graphs.html @@ -31,7 +31,5 @@
- -