@@ -44,13 +44,13 @@
-
76
-
Online
+
{{count.total_earning_count == null ? 0 : count.total_earning_count}}
+
Total
-
19
-
Comment
+
{{count.monthly_earning_count == null ? 0 : count.monthly_earning_count}}
+
Monthly
@@ -172,7 +172,7 @@
- Revenue
+ Practitioner
diff --git a/ng-seed/src/app/dashboard/dashboard.component.ts b/ng-seed/src/app/dashboard/dashboard.component.ts
index a8d3d51..2f507e3 100644
--- a/ng-seed/src/app/dashboard/dashboard.component.ts
+++ b/ng-seed/src/app/dashboard/dashboard.component.ts
@@ -34,18 +34,18 @@ export class DashboardComponent {
}
};
- pieChartData: number[] = [300, 500, 100];
+ pieChartData: number[] = [];
doughnutOptions: any = Object.assign({
elements: {
arc: {
- borderWidth: 5
+ borderWidth: 3
}
}
}, this.globalChartOptions);
doughnutChartColors: any[] = [{
- backgroundColor: ['#673ab7', '#f44336', '#009688 ', '#2196f3']
+ backgroundColor: ['#f44336', '#009688 ', '#2196f3']
}];
- pieChartLabels: string[] = ['Download Sales', 'In-Store Sales', 'Mail Sales'];
+ pieChartLabels: string[] = ['Customer', 'Services', 'Practitioner'];
pieChartType = 'pie';
// Bar
@@ -215,15 +215,25 @@ messages: Object[] = [{
}
ngOnInit() {
- let buiId = {'busId':localStorage.getItem('busId')}
- this.getCount(buiId)
+ let user_role = localStorage.getItem('user_role')
+ let param
+ if(user_role == 'PRACTITIONER'){
+ param = {'user_id':localStorage.getItem('user_id'),'busId':localStorage.getItem('busId')}
+ }else{
+ param = {'busId':localStorage.getItem('busId')}
+ }
+
+ this.getCount(param)
}
getCount(param){
+
+ console.log(param)
this._dash.getCountDetails(param).subscribe(res => {
if (res.status == 200) {
console.log(res)
this.count = res['data']
+ this.pieChartData.push(this.count.customer_count, this.count.practitioner_count, this.count.service_count)
}
})
}