diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index 9f6c96e..b9f1186 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -85,7 +85,7 @@
-

Global Puchases by Category

+

Global Purchases by Category

diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 1c6b481..817d40e 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -266,13 +266,15 @@ export class DashboardComponent { this.setDate(); this.api.orgStats().subscribe( result => { - this.setWeekPurchaseList(result.weeks); - this.setWeekData(result); - this.setChartDataCat(result.data.cat_total); - this.setChartDataEssential(result.data.essentials); - this.totalCategoryList = result.data.cat_list; - if (this.totalCategoryList) { - this.showTotalCategoryList = true; + if (result.data.cat_list.length > 0) { + this.setWeekPurchaseList(result.weeks); + this.setWeekData(result); + this.setChartDataCat(result.data.cat_total); + this.setChartDataEssential(result.data.essentials); + this.totalCategoryList = result.data.cat_list; + if (this.totalCategoryList) { + this.showTotalCategoryList = true; + } } }, error => {