From 7c44188d6ebae2606a8311de91463b23393ed4b4 Mon Sep 17 00:00:00 2001 From: Desy Ayurianti Date: Fri, 29 Nov 2024 15:01:29 +0700 Subject: [PATCH] fix(graph): fix pulign ticks satuan --- .../src/app/pages/dashboard/page/graph/graph.component.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/agrilink_vocpro/src/app/pages/dashboard/page/graph/graph.component.ts b/agrilink_vocpro/src/app/pages/dashboard/page/graph/graph.component.ts index 2b03688..9d29608 100644 --- a/agrilink_vocpro/src/app/pages/dashboard/page/graph/graph.component.ts +++ b/agrilink_vocpro/src/app/pages/dashboard/page/graph/graph.component.ts @@ -301,6 +301,7 @@ export class GraphComponent implements OnInit, AfterViewInit, OnDestroy, OnChang if (this.charts['dht']) { this.filterData(this.activeButton); + console.log(this.activeButton); } } @@ -455,7 +456,7 @@ export class GraphComponent implements OnInit, AfterViewInit, OnDestroy, OnChang grid: { display: false }, beginAtZero: true, ticks: { - callback: (value: number | string) => { + callback: (value: string | number, index: number, values: any) => { if (this.activeButton === 'vicitemperature') { return `${value} °C`; } else if (this.activeButton === 'vicihumidity') { @@ -513,7 +514,7 @@ export class GraphComponent implements OnInit, AfterViewInit, OnDestroy, OnChang grid: { display: false }, beginAtZero: true, ticks:{ - callback: (value: number | string) => { + callback: (value: string | number, index: number, values: any) => { if(selectedOption === 'npk'){ return `${value} mg/L`; } else if(selectedOption === 'temperature'){