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) {