From 156a2f37646c7d3b3951b47f0b268ad419efe57e Mon Sep 17 00:00:00 2001 From: Tom Slater Date: Fri, 16 Aug 2019 16:58:35 +0100 Subject: [PATCH] Misc Chart work --- .../dashboard/dashboard-customer.component.ts | 8 -------- src/app/dashboard/dashboard.component.html | 15 +-------------- src/app/dashboard/leaderboard.component.ts | 4 ++-- .../more-graphs-and-tables.component.ts | 16 +++++++++------- src/app/panels/graph-panel.component.ts | 4 ++-- src/app/panels/org-pie-panel.component.html | 15 +-------------- src/app/panels/org-pie-panel.component.ts | 4 ++-- 7 files changed, 17 insertions(+), 49 deletions(-) diff --git a/src/app/dashboard/dashboard-customer.component.ts b/src/app/dashboard/dashboard-customer.component.ts index 4b77535..e9dccf8 100644 --- a/src/app/dashboard/dashboard-customer.component.ts +++ b/src/app/dashboard/dashboard-customer.component.ts @@ -121,14 +121,6 @@ export class DashboardCustomerComponent implements OnInit { // Graph widgets public widgetList = [ - { - type: 'graph', - name: 'total_duration', - duration: '400', - icon: 'icon-diamond', - title: '(test) last 400 days', - dataType: DataType.currency, - }, { type: 'graph', name: 'total_last_week', diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index cd0d250..1ba65a1 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -59,22 +59,9 @@
-
+

Spending by Category

-
- -
{ let is_item_in_range = (new Date(item.date.substring(0, 10)) >= new Date(start_range) && new Date(item.date.substring(0, 10)) <= new Date(end_range)); // there are a lot of `new Date(blah)` but that is what works for some reason. - + console.log("item.date : " + (item.date)); console.log("Date(item.date) : " + new Date(item.date)); console.log("Date(item.date.substring(0, 10)) : " + new Date(item.date.substring(0, 10))); @@ -75,7 +77,7 @@ export class MoreStuffComponent implements OnInit { // console.log("item.date <= end_range: " + (new Date(item.date) <= new Date(end_range))); // console.log("is_item_in_range: " + is_item_in_range); console.log("----------------------"); - + if (is_item_in_range) { graph_data.push({ t: new Date(item.date.substring(0, 10)), @@ -129,7 +131,7 @@ export class MoreStuffComponent implements OnInit { this.api.loadMiscUrl('organisation/external/supplier_count').subscribe( result => { this.cached_graph_data = result; - + this.supplierBubbleChartData[0].data = this.formatGraphData(result, useRange, start_range, end_range); console.log("Graph fetched with " + this.supplierBubbleChartData[0].data.length + " items."); } @@ -283,8 +285,8 @@ export class MoreStuffComponent implements OnInit { console.log("end_range input box: " + this.lineChartEnd); console.log("end_range : " + new Date(this.lineChartEnd)); - this.loadSupplierBubble(true, (this.bubbleChartBegin), (this.bubbleChartEnd)); - console.log("Bubble chart updating..."); + this.loadYearSpend(); + console.log("Line chart updating..."); } diff --git a/src/app/panels/graph-panel.component.ts b/src/app/panels/graph-panel.component.ts index 8497dce..1a2aa35 100644 --- a/src/app/panels/graph-panel.component.ts +++ b/src/app/panels/graph-panel.component.ts @@ -82,12 +82,12 @@ export class GraphPanel implements OnInit { pointHoverBackgroundColor: '#fff' }, { // brandSuccess - backgroundColor: 'transparent', + backgroundColor: this.convertHex(this.brandInfo, 10), borderColor: this.brandSuccess, pointHoverBackgroundColor: '#fff' }, { // brandDanger - backgroundColor: 'transparent', + backgroundColor: this.convertHex(this.brandDanger, 10), borderColor: this.brandDanger, pointHoverBackgroundColor: '#fff', borderWidth: 1, diff --git a/src/app/panels/org-pie-panel.component.html b/src/app/panels/org-pie-panel.component.html index 81425f4..6973c73 100644 --- a/src/app/panels/org-pie-panel.component.html +++ b/src/app/panels/org-pie-panel.component.html @@ -1,22 +1,9 @@
-
+

All Purchases by Type

-
- -