Add red line for account authorized overdraft.

This commit is contained in:
Alexis Lahouze 2017-07-04 21:13:08 +02:00
parent 2e6bc006f5
commit 4218b741db
2 changed files with 14 additions and 2 deletions

View File

@ -17,3 +17,7 @@
.c3-ygrid-line.zeroline line { .c3-ygrid-line.zeroline line {
stroke: orange; stroke: orange;
} }
.c3-ygrid-line.overdraft line {
stroke: #FF0000;
}

View File

@ -23,10 +23,12 @@ var moment = require('moment'),
var angular = require('angular'); var angular = require('angular');
var account = require('../accounts');
var ngResource = require('angular-resource'); var ngResource = require('angular-resource');
var balanceChartModule = angular.module('balanceChartModule', [ var balanceChartModule = angular.module('balanceChartModule', [
account.name,
ngResource ngResource
]) ])
@ -35,7 +37,7 @@ var balanceChartModule = angular.module('balanceChartModule', [
bindings: { bindings: {
onUpdate: '&' onUpdate: '&'
}, },
controller: function($routeParams, Balances, $element) { controller: function($routeParams, Balances, Account, $element) {
var vm = this; var vm = this;
vm.loadData = function() { vm.loadData = function() {
@ -151,6 +153,12 @@ var balanceChartModule = angular.module('balanceChartModule', [
}); });
vm.loadData(); vm.loadData();
Account.get({id: $routeParams.accountId}, function(result) {
vm.chart.ygrids.add({
value: result.authorized_overdraft, class: 'overdraft'
});
});
}; };
} }
}).factory('Balances', function($resource) { }).factory('Balances', function($resource) {