Update graph creation and styling
This commit is contained in:
@@ -12,7 +12,7 @@ class Graph {
|
|||||||
makeGraph(line, lineColor, name) {
|
makeGraph(line, lineColor, name) {
|
||||||
let div = document.createElement("div");
|
let div = document.createElement("div");
|
||||||
div.setAttribute("id", this.id);
|
div.setAttribute("id", this.id);
|
||||||
document.body.appendChild(div);
|
document.graphBody.appendChild(div);
|
||||||
let lineArray;
|
let lineArray;
|
||||||
switch (line) {
|
switch (line) {
|
||||||
case "temp":
|
case "temp":
|
||||||
@@ -135,7 +135,7 @@ class DataProcessor {
|
|||||||
this.graph.makeGraph("temp", "red", "Temperature");
|
this.graph.makeGraph("temp", "red", "Temperature");
|
||||||
this.graph.makeGraph("humi", "blue", "Humidity");
|
this.graph.makeGraph("humi", "blue", "Humidity");
|
||||||
this.graph.makeGraph("eco2", "green", "eCO2");
|
this.graph.makeGraph("eco2", "green", "eCO2");
|
||||||
this.graph.makeGraph("tvoc", "#F5G644", "TVOC");
|
this.graph.makeGraph("tvoc", "black", "TVOC");
|
||||||
}
|
}
|
||||||
|
|
||||||
updateGraph() {
|
updateGraph() {
|
||||||
|
@@ -31,5 +31,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<script src="graph-classes.js"></script>
|
<script src="graph-classes.js"></script>
|
||||||
<script src="graph-main.js"></script>
|
<script src="graph-main.js"></script>
|
||||||
|
|
||||||
|
<div class="graphBody"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@@ -111,6 +111,8 @@ body {
|
|||||||
align-self: center;
|
align-self: center;
|
||||||
width: 95%;
|
width: 95%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
border-radius: 20px;
|
||||||
|
border: 2px solid #000;
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
/* Additional styling as needed */
|
/* Additional styling as needed */
|
||||||
|
Reference in New Issue
Block a user