diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index b2b88c4..2b13ab5 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -13,8 +13,8 @@ Something else here -

£183.98

-

Money spent this week

+

138

+

Customers this week

9.823

-

Money spent last week

+

Customers last week

{ + console.log(result); + this.thisweekcustomerno = result; + this.lineChart1Data[0].data = this.thisweekcustomerno.customerno; + this.lineChart1Labels = this.thisweekcustomerno.day; + } + ) + } public brandPrimary = '#20a8d8'; public brandSuccess = '#4dbd74'; @@ -45,11 +62,11 @@ export class DashboardComponent implements OnInit { // lineChart1 public lineChart1Data: Array = [ { - data: [44.72, 29.97, 16.65, 30.99, 47.75, 6.95, 6.95], + data: [], label: 'Series A' } ]; - public lineChart1Labels: Array = ['January', 'February', 'March', 'April', 'May', 'June', 'July']; + public lineChart1Labels: Array = []; public lineChart1Options: any = { maintainAspectRatio: false, scales: { @@ -68,8 +85,6 @@ export class DashboardComponent implements OnInit { display: false, ticks: { display: false, - min: 5 - 5, - max: 50 + 5, } }], }, diff --git a/src/app/pages/login.component.ts b/src/app/pages/login.component.ts index 4375b14..f187b74 100644 --- a/src/app/pages/login.component.ts +++ b/src/app/pages/login.component.ts @@ -35,6 +35,10 @@ export class LoginComponent implements OnInit { console.log('Logged out!'); } ); + + this.api.graph_data(undefined).subscribe( + result => { console.log(result) } + ) // get return url from route parameters or default to '/' this.returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/'; diff --git a/src/app/providers/api-service.ts b/src/app/providers/api-service.ts index 6cf34b5..cd1e152 100644 --- a/src/app/providers/api-service.ts +++ b/src/app/providers/api-service.ts @@ -84,4 +84,14 @@ export class ApiService { ).map( response => response.json() ); } + // Fake data to mimic + + public graph_data(data) { + return Observable.of( + { + day : ['Monday', 'tuesday','wednesday','thursday','friday','saturday','sunday'], + customerno : [1,2,3,4,5,6,7], + } + ) + } } \ No newline at end of file