From 559ce50533f5d751637388e1022272d9052e25b9 Mon Sep 17 00:00:00 2001 From: Anurag Vats <anurag.vats@uibk.ac.at> Date: Fri, 2 Dec 2022 19:13:54 +0100 Subject: [PATCH] Refactor chart label --- src/app/dashboard/dashboard.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 4e1b371..495acb5 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -99,7 +99,7 @@ export class DashboardComponent implements OnInit { this.chart.destroy(); this.readings = { labels: res.map((reading: any) => this.getReadableDate(reading.timestamp)), - title: this.sensorsData?.find((sensor: any) => sensor.name === sensorId)?.name, + title: res[0].readings[0].name, data: res.map((reading: any) => reading.readings[0].value) }; this.drawChart(); -- GitLab