From 4218b741db671276632232e108e124a14bc77e7d Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Tue, 4 Jul 2017 21:13:08 +0200 Subject: [PATCH] Add red line for account authorized overdraft. --- src/main.less | 4 ++++ src/operations/balance-chart.component.js | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main.less b/src/main.less index ee541c4..2d6cce8 100644 --- a/src/main.less +++ b/src/main.less @@ -17,3 +17,7 @@ .c3-ygrid-line.zeroline line { stroke: orange; } + +.c3-ygrid-line.overdraft line { + stroke: #FF0000; +} diff --git a/src/operations/balance-chart.component.js b/src/operations/balance-chart.component.js index 8057659..422b7c3 100644 --- a/src/operations/balance-chart.component.js +++ b/src/operations/balance-chart.component.js @@ -23,10 +23,12 @@ var moment = require('moment'), var angular = require('angular'); +var account = require('../accounts'); + var ngResource = require('angular-resource'); - var balanceChartModule = angular.module('balanceChartModule', [ + account.name, ngResource ]) @@ -35,7 +37,7 @@ var balanceChartModule = angular.module('balanceChartModule', [ bindings: { onUpdate: '&' }, - controller: function($routeParams, Balances, $element) { + controller: function($routeParams, Balances, Account, $element) { var vm = this; vm.loadData = function() { @@ -151,6 +153,12 @@ var balanceChartModule = angular.module('balanceChartModule', [ }); vm.loadData(); + + Account.get({id: $routeParams.accountId}, function(result) { + vm.chart.ygrids.add({ + value: result.authorized_overdraft, class: 'overdraft' + }); + }); }; } }).factory('Balances', function($resource) {