feat(web-app): plot humidity and temperature
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user