Update graph colors and scale for temperature, eCO2, and TVOC

This commit is contained in:
Sietse Jonker
2024-03-06 15:59:54 +01:00
parent 199283d3e0
commit 63be84e287

View File

@@ -17,7 +17,7 @@ class liveGraph {
x: this.timeArray, // Use timeArray as x values x: this.timeArray, // Use timeArray as x values
y: this.tempArray, y: this.tempArray,
mode: "lines", mode: "lines",
line: { color: "#80CAF6" }, line: { color: "#FF0000" },
name: "Temperature", name: "Temperature",
}, },
]); ]);
@@ -35,8 +35,8 @@ class liveGraph {
x: this.timeArray, // Use timeArray as x values x: this.timeArray, // Use timeArray as x values
y: this.eco2Array, y: this.eco2Array,
mode: "lines", mode: "lines",
line: { color: "#80CAF6" }, line: { color: "#FFA500" },
name: "eCO2", name: "eCO2 / 10",
}, },
]); ]);
Plotly.plot(this.nodeId, [ Plotly.plot(this.nodeId, [
@@ -44,8 +44,8 @@ class liveGraph {
x: this.timeArray, // Use timeArray as x values x: this.timeArray, // Use timeArray as x values
y: this.tvocArray, y: this.tvocArray,
mode: "lines", mode: "lines",
line: { color: "#80CAF6" }, line: { color: "#000000" },
name: "TVOC", name: "TVOC / 10",
}, },
]); ]);
} }
@@ -76,7 +76,7 @@ class liveGraph {
// Update the graph // Update the graph
this.tempArray.push(temperature); this.tempArray.push(temperature);
this.humiArray.push(humidity); this.humiArray.push(humidity);
this.eco2Array.push(eCO2); this.eco2Array.push(eCO2 / 10);
this.tvocArray.push(TVOC); this.tvocArray.push(TVOC / 10);
} }
} }