From 2cb17c12dd321531116802bee6c63938988818a2 Mon Sep 17 00:00:00 2001 From: Tom Slater Date: Wed, 21 Aug 2019 11:51:10 +0100 Subject: [PATCH] Colour fixes --- .../dashboard-customer.component.html | 1 + .../dashboard/dashboard-customer.component.ts | 24 +++++++++++++++---- src/app/dashboard/dashboard.component.html | 1 + src/app/dashboard/dashboard.component.ts | 24 ++++++++++++++++--- src/app/panels/pie-panel.component.ts | 2 +- 5 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/app/dashboard/dashboard-customer.component.html b/src/app/dashboard/dashboard-customer.component.html index 708724e..3638329 100644 --- a/src/app/dashboard/dashboard-customer.component.html +++ b/src/app/dashboard/dashboard-customer.component.html @@ -73,6 +73,7 @@ [datasets]="barChartDataCategory" [labels]="barChartLabelsCategory" [options]="barChartOptionsCategory" + [colors]="barChartColoursCategory" [legend]="barChartLegendCategory" [chartType]="barChartTypeCategory" (chartHover)="chartHovered($event)" diff --git a/src/app/dashboard/dashboard-customer.component.ts b/src/app/dashboard/dashboard-customer.component.ts index 358cc0a..eae9edd 100644 --- a/src/app/dashboard/dashboard-customer.component.ts +++ b/src/app/dashboard/dashboard-customer.component.ts @@ -42,16 +42,17 @@ export class DashboardCustomerComponent implements OnInit { public doughnutChartColoursCategory: any[] = [ { backgroundColor:[ - 'red', + '#ffa1b5', 'green', - 'blue', + '#52afed', 'purple', 'yellow', 'brown', 'magenta', 'cyan', 'orange', - 'pink' + 'red', + '#000000' ] }]; @@ -117,7 +118,22 @@ export class DashboardCustomerComponent implements OnInit { public barChartLegendCategory:boolean = false; public barChartDataCategory:any[]=[]; public barChartLabelsCategory:string[] = []; - + public barChartColoursCategory: any[] = [ + { + backgroundColor:[ + '#ffa1b5', + 'green', + '#52afed', + 'purple', + 'yellow', + 'brown', + 'magenta', + 'cyan', + 'orange', + 'red', + '#000000' + ] + }]; weekPurchaseList = { diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index 1169a33..f67a0a1 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -68,6 +68,7 @@ [datasets]="doughnutChartDataCategory" [labels]="doughnutChartLabelsCategory" [options]="doughnutChartOptionsCategory" + [colors]="doughnutChartColoursCategory" [legend]="chartLegend" [chartType]="chartType" (chartHover)="chartHovered($event)" diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index 099c65a..e12dbfa 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -80,6 +80,23 @@ export class DashboardComponent { public chartLegend = true; public doughnutChartDataCategory: any[] = []; public doughnutChartLabelsCategory: string[] = []; + public doughnutChartColoursCategory: any[] = [ + { + backgroundColor:[ + '#ffa1b5', + 'green', + '#52afed', + 'purple', + 'yellow', + 'brown', + 'magenta', + 'cyan', + 'orange', + 'red', + '#000000' + ] + }]; + public doughnutChartOptionsCategory:any = { tooltips: { @@ -121,16 +138,17 @@ export class DashboardComponent { public barChartColoursCategory: any[] = [ { backgroundColor:[ - 'red', + '#ffa1b5', 'green', - 'blue', + '#52afed', 'purple', 'yellow', 'brown', 'magenta', 'cyan', 'orange', - 'pink' + 'red', + '#000000' ] }]; diff --git a/src/app/panels/pie-panel.component.ts b/src/app/panels/pie-panel.component.ts index f7148b0..b0c912f 100644 --- a/src/app/panels/pie-panel.component.ts +++ b/src/app/panels/pie-panel.component.ts @@ -27,7 +27,7 @@ export class PiePanel implements OnInit { 'magenta', 'cyan', 'orange', - 'pink' + 'pink', ] }, { borderColor:[