From c206a394d26360496df6e1115ffb6f9080f9d8dc Mon Sep 17 00:00:00 2001 From: Tom Slater Date: Fri, 9 Aug 2019 10:21:40 +0100 Subject: [PATCH] Added time filter options + Chart Labels Cleaned up graphs that aren't relevant to this particular page, added chart labels and a WIP time filter option --- .../dashboard-customer.component.html | 112 +++++------------- .../dashboard/dashboard-customer.component.ts | 7 -- .../more-graphs-and-tables.component.html | 38 ++++-- .../more-graphs-and-tables.component.ts | 6 - src/app/panels/graph-panel.component.html | 11 +- src/app/panels/org-pie-panel.component.html | 2 +- src/app/panels/org-pie-panel.component.ts | 2 +- src/app/panels/pie-panel.component.html | 2 +- src/app/panels/pie-panel.component.ts | 21 +++- 9 files changed, 89 insertions(+), 112 deletions(-) diff --git a/src/app/dashboard/dashboard-customer.component.html b/src/app/dashboard/dashboard-customer.component.html index ec3e8ad..f02f3c1 100644 --- a/src/app/dashboard/dashboard-customer.component.html +++ b/src/app/dashboard/dashboard-customer.component.html @@ -65,66 +65,7 @@
-

Weekly Purchase No.

-
-
-
-
    -
  • - This Week - {{ (weekPurchaseList.first || 0 ) }} - ({{ (weekPurchaseList.first || 0 ) / weekPurchaseList.max | percent:'1.0-0' }}) -
    -
    -
    -
    -
    -
  • -
  • - Last Week - {{ weekPurchaseList.second || 0 }} - ({{ (weekPurchaseList.second || 0 ) / weekPurchaseList.max | percent:'1.0-0' }}) -
    -
    -
    -
    -
    -
  • -
  • - Week Maximum - {{ weekPurchaseList.max || 0 }} - (100%) -
    -
    -
    -
    -
    -
  • -
  • - Weekly Average - {{ (weekPurchaseList.sum / weekPurchaseList.count) || 0 | number:'1.0-0'}} - ({{ ((weekPurchaseList.sum / weekPurchaseList.count) || 0) / weekPurchaseList.max | percent:'1.0-0' }}) -
    -
    -
    -
    -
    -
  • -
-
-
- - -
-
-
-
-
-

All Purchases by Category

+

Your Purchases by Category

@@ -137,26 +78,37 @@ (chartHover)="chartHovered($event)" (chartClick)="chartClicked($event)">
-
-
    - -
  • - -
    -
    {{ category.category || 'N/A' }}
    -
    -
    -
    Bought
    - {{ category.value || 'N/A' }} -
    -
  • -
  • - -
  • -
-
- - +
+
+
+
+
+

Global Puchases by Category

+
+
+
+
    + +
  • + +
    +
    {{ category.category || 'N/A' }}
    +
    +
    +
    Bought
    + {{ category.value || 'N/A' }} +
    +
  • +
  • + +
  • +
+
+
+
+
+
+
diff --git a/src/app/dashboard/dashboard-customer.component.ts b/src/app/dashboard/dashboard-customer.component.ts index d4eaa54..e9dccf8 100644 --- a/src/app/dashboard/dashboard-customer.component.ts +++ b/src/app/dashboard/dashboard-customer.component.ts @@ -76,13 +76,6 @@ export class DashboardCustomerComponent implements OnInit { stacked:true, }], - yAxes:[{ - scaleLabel: { - display:true, - labelString: 'Organisation purchase amount' - }, - stacked:true, - }] } }; public barChartTypeEssential:string = 'horizontalBar'; diff --git a/src/app/dashboard/more-graphs-and-tables.component.html b/src/app/dashboard/more-graphs-and-tables.component.html index 4181e96..c93e80b 100644 --- a/src/app/dashboard/more-graphs-and-tables.component.html +++ b/src/app/dashboard/more-graphs-and-tables.component.html @@ -2,9 +2,22 @@
-
+

Spend amount and number of purchases by supplier name

+
+ +
-
+

Spend amount and number of organisations

+
+ +

Supplier Spend History

-
- -
-
+
-

All Purchases

+

All Purchases by Type

diff --git a/src/app/panels/org-pie-panel.component.ts b/src/app/panels/org-pie-panel.component.ts index 24454c0..75ada9b 100644 --- a/src/app/panels/org-pie-panel.component.ts +++ b/src/app/panels/org-pie-panel.component.ts @@ -12,7 +12,7 @@ import { ChartData } from '../_interfaces/chart-data'; export class OrgPiePanel implements OnInit { - public chartType = 'doughnut'; + public chartType = 'pie'; public chartLegend = true; public doughnutChartDataLocal: number[] = []; public doughnutChartColors: any[] = [ diff --git a/src/app/panels/pie-panel.component.html b/src/app/panels/pie-panel.component.html index da2417e..0a3846d 100644 --- a/src/app/panels/pie-panel.component.html +++ b/src/app/panels/pie-panel.component.html @@ -2,7 +2,7 @@
-

All Purchases

+

All Purchases by Category

diff --git a/src/app/panels/pie-panel.component.ts b/src/app/panels/pie-panel.component.ts index 1c2571a..2e3e4a7 100644 --- a/src/app/panels/pie-panel.component.ts +++ b/src/app/panels/pie-panel.component.ts @@ -12,11 +12,12 @@ import { ChartData } from '../_interfaces/chart-data'; export class PiePanel implements OnInit { - public chartType = 'doughnut'; + public chartType = 'pie'; public chartLegend = true; public doughnutChartDataLocal: number[] = []; public doughnutChartLabelsLocal: string[] = []; - public doughnutChartColors: any[] = [{ backgroundColor: [ + public doughnutChartColors: any[] = [ + { backgroundColor: [ 'red', 'green', 'blue', @@ -28,7 +29,21 @@ export class PiePanel implements OnInit { 'orange', 'pink' ] - }]; +}, + { borderColor:[ + 'red', + 'green', + 'blue', + 'purple', + 'yellow', + 'brown', + 'magenta', + 'cyan', + 'orange', + 'pink' + ] + } +]; constructor( private api: ApiService,