feat(web-app): plot humidity and temperature

This commit is contained in:
fastium
2025-05-13 17:27:06 +02:00
parent e13170ed1b
commit 899592b493
6 changed files with 409 additions and 69 deletions

View File

@@ -23,14 +23,16 @@ export class Serie {
}
public getLabel(): string {
return `${this._user} - ${this._room} - ${this._device}`;
return `${this._type} - ${this._user} - ${this._room} - ${this._device}`;
}
public getSerie(): any {
if (this._type === TEMPERATURE) {
return {
label: this.getLabel(),
data: this._data,
data: this._data.map((v: any) => {
return { x: v.time, y: v.value };
}),
borderColor: "rgba(255, 99, 132, 1)",
backgroundColor: "rgba(255, 99, 132, 0.2)",
borderWidth: 1,
@@ -38,7 +40,9 @@ export class Serie {
} else if (this._type === HUMIDITY) {
return {
label: this.getLabel(),
data: this._data,
data: this._data.map((v: any) => {
return { x: v.time, y: v.value };
}),
borderColor: "rgba(54, 162, 235, 1)",
backgroundColor: "rgba(54, 162, 235, 0.2)",
borderWidth: 1,