From 420174e953083eb1de804d8d31cbb5414c7e9269 Mon Sep 17 00:00:00 2001 From: Tom Slater Date: Wed, 28 Aug 2019 10:47:44 +0100 Subject: [PATCH] chart work --- .../more-graphs-and-tables.component.html | 2 +- .../more-graphs-and-tables.component.ts | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/app/dashboard/more-graphs-and-tables.component.html b/src/app/dashboard/more-graphs-and-tables.component.html index d535132..4e6f05e 100644 --- a/src/app/dashboard/more-graphs-and-tables.component.html +++ b/src/app/dashboard/more-graphs-and-tables.component.html @@ -53,7 +53,7 @@

Supplier Spend History

- +
diff --git a/src/app/dashboard/more-graphs-and-tables.component.ts b/src/app/dashboard/more-graphs-and-tables.component.ts index 3fdc06f..e01cf3a 100644 --- a/src/app/dashboard/more-graphs-and-tables.component.ts +++ b/src/app/dashboard/more-graphs-and-tables.component.ts @@ -18,6 +18,7 @@ export class MoreStuffComponent implements OnInit { bubbleChartEnd: any; cached_graph_data: any; isBubbleChartLoaded = false; + isLineChartLoaded = false; constructor( private api: ApiService, @@ -30,7 +31,7 @@ export class MoreStuffComponent implements OnInit { } ngOnInit(): void { - this.loadYearSpend(); + this.loadYearSpend(false, ('0'), ('0')); this.loadSupplierBubble(false, ('0'), ('0')); this.loadSupplierHistory(); } @@ -62,22 +63,8 @@ export class MoreStuffComponent implements OnInit { let graph_data = []; if (useRange == true) { - // console.log("using range " + start_range + " : " + end_range); passed_graph_data.data.map(item=> { 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))); - // console.log("start_range input box: " + start_range); - // console.log("start_range : " + new Date(start_range)); - // console.log("end_range input box: " + end_range); - // console.log("end_range : " + new Date(end_range)); - // console.log("item.date >= start_range: " + (new Date(item.date) >= new Date(start_range))); - // 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({