Fix category loading.
This commit is contained in:
parent
facc1c5a0d
commit
d7de013954
@ -53,17 +53,22 @@ var categoryChartModule = angular.module('categoryChartModule', [
|
|||||||
expensesColor = 'orange';
|
expensesColor = 'orange';
|
||||||
|
|
||||||
angular.forEach(results, function(result) {
|
angular.forEach(results, function(result) {
|
||||||
var revenuesName = 'revenues-' + result.category;
|
|
||||||
|
|
||||||
revenues.push([revenuesName, result.revenues]);
|
if(result.revenues > 0) {
|
||||||
names[revenuesName] = result.category;
|
var revenuesName = 'revenues-' + result.category;
|
||||||
colors[revenuesName] = revenuesColor;
|
|
||||||
|
|
||||||
var expensesName = 'expenses-' + result.category;
|
revenues.push([revenuesName, result.revenues]);
|
||||||
|
names[revenuesName] = result.category;
|
||||||
|
colors[revenuesName] = revenuesColor;
|
||||||
|
}
|
||||||
|
|
||||||
expenses.splice(0, 0, [expensesName, -result.expenses]);
|
if(result.expenses < 0) {
|
||||||
names[expensesName] = result.category;
|
var expensesName = 'expenses-' + result.category;
|
||||||
colors[expensesName] = expensesColor;
|
|
||||||
|
expenses.splice(0, 0, [expensesName, -result.expenses]);
|
||||||
|
names[expensesName] = result.category;
|
||||||
|
colors[expensesName] = expensesColor;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
vm.chart.unload();
|
vm.chart.unload();
|
||||||
|
Loading…
Reference in New Issue
Block a user