From 932ee113c2bec54f5240bfd6dfb1a7a2c28369f8 Mon Sep 17 00:00:00 2001 From: Tom Slater Date: Wed, 14 Aug 2019 09:49:18 +0100 Subject: [PATCH] Work on date picker function on bubble chart --- package-lock.json | 8 ++++ package.json | 1 + .../dashboard-customer.component.html | 47 ++++++++++++++++-- src/app/dashboard/dashboard.component.html | 48 +++++++++++++++++-- src/app/dashboard/dashboard.component.ts | 2 +- .../more-graphs-and-tables.component.html | 26 ++-------- .../more-graphs-and-tables.component.ts | 3 +- src/app/panels/org-pie-panel.component.html | 15 +++++- src/app/panels/org-pie-panel.component.ts | 2 + src/app/panels/pie-panel.component.html | 15 +++++- src/app/panels/pie-panel.component.ts | 10 ++-- 11 files changed, 139 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index b969ab3..be91835 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7136,6 +7136,14 @@ "resolved": "https://registry.npmjs.org/ngx-bootstrap/-/ngx-bootstrap-5.0.0.tgz", "integrity": "sha512-5TTFP9s3wfiRychGcdyvpCvvxtxW1Nf2Dqmk2YBzuIhHHLT6gRq1Fsic4lYrtAUwmy0PSLhOY/XW/saYKlrSJw==" }, + "ngx-daterangepicker-material": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/ngx-daterangepicker-material/-/ngx-daterangepicker-material-2.1.8.tgz", + "integrity": "sha512-nSS/M2CQnUSfzZwy+V5mcnE+tjqwmr+HusIDYmiE1zNARG7gkEzYWBmXIOxsC1Dx9snA3NMpqqXj2NitIhyHig==", + "requires": { + "tslib": "^1.9.0" + } + }, "ngx-pagination": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/ngx-pagination/-/ngx-pagination-4.0.0.tgz", diff --git a/package.json b/package.json index ce48a88..7d11aff 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "ng2-charts": "^2.3.0", "ng2-validation-manager": "0.5.3", "ngx-bootstrap": "^5.0.0", + "ngx-daterangepicker-material": "^2.1.8", "ngx-pagination": "^4.0.0", "popper.js": "^1.15.0", "rxjs": "6.5.2", diff --git a/src/app/dashboard/dashboard-customer.component.html b/src/app/dashboard/dashboard-customer.component.html index f02f3c1..2cc1863 100644 --- a/src/app/dashboard/dashboard-customer.component.html +++ b/src/app/dashboard/dashboard-customer.component.html @@ -22,8 +22,21 @@
-
-

Weekly Spending by Category

+
+

Spending by Category

+
+
+
@@ -44,9 +57,22 @@
-
+

No. of Essential Purchases

+
+ +
-
+

Your Purchases by Category

+
+ +
@@ -16,9 +17,22 @@
-
+

No. of Essential Purchases

+
+ +
-
+

All Organisation Purchases by Category

+
+ +
-
-

Weekly Spending by Category

+
+

Spending by Category

+
+
+
diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index ee10b2b..2759842 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -76,7 +76,7 @@ export class DashboardComponent { public bootstrapColours: string[] = ['bg-primary', 'bg-secondary', 'bg-success', 'bg-danger', 'bg-warning', 'bg-info']; - public chartType = 'pie'; + public chartType = 'doughnut'; public chartLegend = true; public doughnutChartDataCategory: any[] = []; public doughnutChartLabelsCategory: string[] = []; diff --git a/src/app/dashboard/more-graphs-and-tables.component.html b/src/app/dashboard/more-graphs-and-tables.component.html index c93e80b..bd2f671 100644 --- a/src/app/dashboard/more-graphs-and-tables.component.html +++ b/src/app/dashboard/more-graphs-and-tables.component.html @@ -6,17 +6,8 @@

Spend amount and number of purchases by supplier name

- + +
@@ -37,17 +28,8 @@

Spend amount and number of organisations

- + +
diff --git a/src/app/dashboard/more-graphs-and-tables.component.ts b/src/app/dashboard/more-graphs-and-tables.component.ts index 89a35fb..b6f82a6 100644 --- a/src/app/dashboard/more-graphs-and-tables.component.ts +++ b/src/app/dashboard/more-graphs-and-tables.component.ts @@ -54,7 +54,7 @@ export class MoreStuffComponent implements OnInit { result.data.map(item => { graph_data.push({ t: item.date, - r: (item.value / 100000) + 5, + r: (item.value / 100000) + 4, supplier: item.seller, y: item.count, value: item.value, @@ -75,6 +75,7 @@ export class MoreStuffComponent implements OnInit { borderColor: 'blue', hoverBackgroundColor: 'blue', hoverBorderColor: 'blue', + radius: 5, }, ]; public supplierBubbleChartLabels: string[] = []; diff --git a/src/app/panels/org-pie-panel.component.html b/src/app/panels/org-pie-panel.component.html index 6973c73..81425f4 100644 --- a/src/app/panels/org-pie-panel.component.html +++ b/src/app/panels/org-pie-panel.component.html @@ -1,9 +1,22 @@
-
+

All Purchases by Type

+
+ +
-
+

All Purchases by Category

+
+ +