From 4d9faf74065996950233a1e224ede9dffc767c6f Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sun, 10 Jun 2018 11:06:26 +0200 Subject: [PATCH] Add expenses and revenues graphs, change graph colors. --- src/operations/balanceChart.component.ts | 27 +++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/operations/balanceChart.component.ts b/src/operations/balanceChart.component.ts index 2d80b0a..f73ae89 100644 --- a/src/operations/balanceChart.component.ts +++ b/src/operations/balanceChart.component.ts @@ -61,21 +61,24 @@ export class BalanceChartComponent implements OnChanges { }; public seriesGroups: any = [{ - // type: 'column', - // series: [{ - // dataField: 'revenues' - // }, { - // dataField: 'expenses' - // }] - //}, { + type: 'stackedcolumn', + series: [{ + dataField: 'expenses', + fillColor: 'red' + }, { + dataField: 'revenues', + fillColor: 'green' + }] + }, { type: 'line', series: [{ - dataField: 'balance' + dataField: 'balance', + fillColor: 'blue' }], bands: [{ - minValue: 0, maxValue: 0, fillColor: 'orange', lineWidth: 2 + minValue: 0, maxValue: 0, fillColor: 'orange', lineWidth: 1 }, { - minValue: 0, maxValue: 0, fillColor: 'red', lineWidth: 2 + minValue: 0, maxValue: 0, fillColor: 'red', lineWidth: 1 }] }]; @@ -100,8 +103,8 @@ export class BalanceChartComponent implements OnChanges { setLines(account: Account) { if (account) { - this.seriesGroups[0].bands[1].minValue = account.authorized_overdraft; - this.seriesGroups[0].bands[1].maxValue = account.authorized_overdraft; + this.seriesGroups[1].bands[1].minValue = account.authorized_overdraft; + this.seriesGroups[1].bands[1].maxValue = account.authorized_overdraft; } }