From 14ea59ad745a52c01291b4fa2bb65c79715b8a56 Mon Sep 17 00:00:00 2001 From: Surendiran Date: Tue, 6 Jun 2023 19:12:25 +0530 Subject: [PATCH] Dashboard issue fix --- .../src/app/dashboard/dashboard.component.ts | 43 ++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/ng-seed/src/app/dashboard/dashboard.component.ts b/ng-seed/src/app/dashboard/dashboard.component.ts index 8555b7c..b530a9d 100644 --- a/ng-seed/src/app/dashboard/dashboard.component.ts +++ b/ng-seed/src/app/dashboard/dashboard.component.ts @@ -327,7 +327,7 @@ messages: Object[] = [{ currentDate: Date; lineChart: any = []; user_role: any; - currency: any; + currency: any = 'INR'; countAndRevenue: boolean = false; currencyHtmlCode: any; @@ -340,11 +340,14 @@ messages: Object[] = [{ ); this.user_role = localStorage.getItem('user_role') - this.currency = localStorage.getItem('currency') - console.log(this.currency) - // Usage example - // const currencyName = 'INR'; - this.currencyHtmlCode = this.getCurrencyHtmlCode(this.currency); + + this.currency = localStorage.getItem('currency') + console.log(this.currency) + // Usage example + // const currencyName = 'INR'; + if(this.currency != null && this.currency != 'null'){ + this.currencyHtmlCode = this.getCurrencyHtmlCode(this.currency); + } } ngOnInit() { @@ -374,6 +377,13 @@ messages: Object[] = [{ } getCount(param){ + this.currency = localStorage.getItem('currency') + console.log(this.currency) + // Usage example + // const currencyName = 'INR'; + if(this.currency != null && this.currency != 'null'){ + this.currencyHtmlCode = this.getCurrencyHtmlCode(this.currency); + } console.log(param) this._dash.getCountDetails(param).subscribe(res => { if (res.status == 200) { @@ -398,6 +408,13 @@ messages: Object[] = [{ } getPieChartData(param){ + this.currency = localStorage.getItem('currency') + console.log(this.currency) + // Usage example + // const currencyName = 'INR'; + if(this.currency != null && this.currency != 'null'){ + this.currencyHtmlCode = this.getCurrencyHtmlCode(this.currency); + } console.log(param) this._dash.getPieChartDetails(param).subscribe(res => { if (res.status == 200) { @@ -445,6 +462,13 @@ messages: Object[] = [{ getPieChartServiceData(param){ + this.currency = localStorage.getItem('currency') + console.log(this.currency) + // Usage example + // const currencyName = 'INR'; + if(this.currency != null && this.currency != 'null'){ + this.currencyHtmlCode = this.getCurrencyHtmlCode(this.currency); + } console.log(param) this._dash.getPieChartServiceDetails(param).subscribe(res => { if (res.status == 200) { @@ -476,6 +500,13 @@ messages: Object[] = [{ }) } getLineChartData(param){ + this.currency = localStorage.getItem('currency') + console.log(this.currency) + // Usage example + // const currencyName = 'INR'; + if(this.currency != null && this.currency != 'null'){ + this.currencyHtmlCode = this.getCurrencyHtmlCode(this.currency); + } console.log(param) this._dash.getLineChart(param).subscribe(res => { if (res.status == 200) {