From ec49bff840758ae474f302fa3ccb1fb3ca3e6970 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Tue, 5 Sep 2017 12:04:36 +0100 Subject: [PATCH] Added extra widgets and fixed api issue --- src/app/dashboard/dashboard.component.ts | 22 ++++++++++++++++++++++ src/app/widgets/graph-widget.component.ts | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 47da3e5..407d643 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -39,6 +39,28 @@ export class DashboardComponent implements OnInit { icon: 'icon-people', title: 'Customers Last 30 Days', }, + { + type: 'graph', + name: 'sales_last_7_days', + icon: 'icon-diamond', + title: 'Sales Last 7 Days', + }, + { + type: 'graph', + name: 'sales_last_30_days', + icon: 'icon-diamond', + title: 'Sales Last 30 Days', + }, + { + type: 'graph', + name: 'purchases_last_7_days', + title: 'Purchases Last 7 Days', + }, + { + type: 'graph', + name: 'purchases_last_30_days', + title: 'Purchases Last 30 Days', + }, ]; constructor( diff --git a/src/app/widgets/graph-widget.component.ts b/src/app/widgets/graph-widget.component.ts index cdf9ae7..aaa4f9a 100644 --- a/src/app/widgets/graph-widget.component.ts +++ b/src/app/widgets/graph-widget.component.ts @@ -83,8 +83,8 @@ export class GraphWidget implements OnInit { } private setData(data: any) { - this.setChartData(data.count); - this.setChartLabels(data.day); + this.setChartData(data.data); + this.setChartLabels(data.labels); } private setChartData(data: Array) {