From a605d66d37aee8b29ae9ab1137358b6d6a07c8ac Mon Sep 17 00:00:00 2001 From: Tom Slater Date: Wed, 14 Aug 2019 12:07:05 +0100 Subject: [PATCH] work on date picker bubble chart --- .../dashboard/more-graphs-and-tables.component.html | 8 ++++---- .../dashboard/more-graphs-and-tables.component.ts | 12 ++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/app/dashboard/more-graphs-and-tables.component.html b/src/app/dashboard/more-graphs-and-tables.component.html index bd2f671..193dde7 100644 --- a/src/app/dashboard/more-graphs-and-tables.component.html +++ b/src/app/dashboard/more-graphs-and-tables.component.html @@ -6,8 +6,8 @@

Spend amount and number of purchases by supplier name

- - + +
@@ -28,8 +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 b6f82a6..2550e2c 100644 --- a/src/app/dashboard/more-graphs-and-tables.component.ts +++ b/src/app/dashboard/more-graphs-and-tables.component.ts @@ -3,6 +3,7 @@ import {ApiService} from '../providers/api-service'; import {BaseChartDirective, Color} from 'ng2-charts'; import {CurrencyPipe} from '@angular/common'; import {ChartType} from "chart.js"; +import * as moment from 'moment'; @Component({ templateUrl: 'more-graphs-and-tables.component.html', @@ -10,11 +11,14 @@ import {ChartType} from "chart.js"; export class MoreStuffComponent implements OnInit { @Output() public onClick = new EventEmitter(); @Input() public categories: any; - + bubbleChartBegin: any; + bubbleChartEnd: any; constructor( private api: ApiService, private currencyPipe: CurrencyPipe, ) { + this.bubbleChartBegin = moment().format('YYYY-MM-DD'); + this.bubbleChartEnd = moment().format('YYYY-MM-DD'); } ngOnInit(): void { @@ -54,7 +58,7 @@ export class MoreStuffComponent implements OnInit { result.data.map(item => { graph_data.push({ t: item.date, - r: (item.value / 100000) + 4, + r: item.value > 1000000 ? (item.value / 1000000) + 10 : (item.value / 100000) + 5, supplier: item.seller, y: item.count, value: item.value, @@ -140,6 +144,10 @@ export class MoreStuffComponent implements OnInit { ) } + bubbleChartUpdate() { + + } + public yearSpendChartData: any[] = [ { data: [],