diff --git a/src/app/dashboard/dashboard-customer.component.html b/src/app/dashboard/dashboard-customer.component.html
index 1278c05..5be3628 100644
--- a/src/app/dashboard/dashboard-customer.component.html
+++ b/src/app/dashboard/dashboard-customer.component.html
@@ -117,80 +117,80 @@
-
-
+
-
Sector A
-
Lorem ipsum dolor sit amet
+
Sector {{ sectorLetters[0] || 'N/A' }}
+
{{ sectorNames [sectorLetters[0]] }}
Bought from Sector
-
1.924
+
{{ sectorPurchases[0] || 'N/A' }}
-
-
+
-
Sector B
-
Lorem ipsum dolor sit amet
+
Sector {{ sectorLetters[1] || 'N/A' }}
+
{{ sectorNames [sectorLetters[1]] || 'N/A' }}
Bought from Sector
-
1.224
+
{{ sectorPurchases[1] || 'N/A' }}
-
-
+
-
Sector C
-
Lorem ipsum dolor sit amet
+
Sector {{ sectorLetters[2] || 'N/A' }}
+
{{ sectorNames [sectorLetters[2]] || 'N/A' }}
Bought from Sector
-
1.163
+
{{ sectorPurchases[2] || 'N/A' }}
-
-
+
-
Sector D
-
Lorem ipsum dolor sit amet
+
Sector {{ sectorLetters[3] || 'N/A' }}
+
{{ sectorNames [sectorLetters[3]] || 'N/A' }}
Bought from Sector
-
928
+
{{ sectorPurchases[3] || 'N/A' }}
-
-
+
-
Sector E
-
Lorem ipsum dolor sit amet
+
Sector {{ sectorLetters[4] || 'N/A' }}
+
{{ sectorNames [sectorLetters[4]] || 'N/A' }}
Bought from Sector
-
893
+
{{ sectorPurchases[4] || 'N/A' }}
-
-
+
-
Sector F
-
Lorem ipsum dolor sit amet
+
Sector {{ sectorLetters[5] || 'N/A' }}
+
{{ sectorNames [sectorLetters[5]] || 'N/A' }}
Bought from Sector
-
121.924
+
{{ sectorPurchases[5] || 'N/A' }}
-
-
+
-
Sector G
-
Lorem ipsum dolor sit amet
+
Sector {{ sectorLetters[6] || 'N/A' }}
+
{{ sectorNames [sectorLetters[6]] || 'N/A' }}
Bought from Sector
-
12.125
+
{{ sectorPurchases[6] || 'N/A' }}
diff --git a/src/app/dashboard/dashboard-customer.component.ts b/src/app/dashboard/dashboard-customer.component.ts
index f404496..5b84574 100644
--- a/src/app/dashboard/dashboard-customer.component.ts
+++ b/src/app/dashboard/dashboard-customer.component.ts
@@ -29,6 +29,55 @@ export class DashboardCustomerComponent implements OnInit {
week_6: 0,
};
+ sectorNames = {
+ A: 'Agriculture, Forestry & Fishing',
+ B: 'Mining & Quarrying',
+ C: 'Manufacturing',
+ D: 'Electricity, Gas, Steam & Air Conditioning',
+ E: 'Water & Waste Management',
+ F: 'Construction',
+ G: 'Wholesale & Retail Trade',
+ H: 'Transportation & Storage',
+ I: 'Accomodation & Food Services',
+ J: 'Information & Communication',
+ K: 'Financial & Insurance Activities',
+ L: 'Real Estate',
+ M: 'Professional, Scientfic & Technical',
+ N: 'Administrative & Support Services',
+ O: 'Public Administration, Defence & Social Security',
+ P: 'Education',
+ Q: 'Human Health & Social Work',
+ R: 'Arts, Entertainment & Recreation',
+ S: 'Other Service Activities',
+ T: 'Household Domestic Business',
+ }
+
+ sectorIcons = {
+ A: 'icon-drop',
+ B: 'icon-diamond',
+ C: 'icon-settings',
+ D: 'icon-energy',
+ E: 'icon-trash',
+ F: 'icon-wrench',
+ G: 'icon-tag',
+ H: 'icon-speedometer',
+ I: 'icon-cup',
+ J: 'icon-globe',
+ K: 'icon-credit-card',
+ L: 'icon-graph',
+ M: 'icon-chemistry',
+ N: 'icon-drawer',
+ O: 'icon-pie-chart',
+ P: 'icon-graduation',
+ Q: 'icon-support',
+ R: 'icon-film',
+ S: 'icon-calendar',
+ T: 'icon-home',
+ }
+
+ sectorLetters: string[] = [];
+ sectorPurchases: number[] = [];
+
sectorList: any;
// Graph widgets
@@ -66,8 +115,8 @@ export class DashboardCustomerComponent implements OnInit {
) {
this.api.basicStats().subscribe(
result => {
- this.setWeekPurchaseList(result.data);
-
+ this.setWeekPurchaseList(result.weeks);
+ this.setSectorList(result.sectors);
},
error => {
console.log('Retrieval Error');
@@ -92,7 +141,11 @@ export class DashboardCustomerComponent implements OnInit {
if (! b) { b = 0 }
return Math.max(a,b);
});
- console.log(this.maxPurchase);
+ }
+
+ public setSectorList (data: any) {
+ this.sectorLetters = Object.values(data.sectors);
+ this.sectorPurchases = Object.values(data.purchases);
}
ngOnInit(): void {