firefly-iii/public/js/index.js

25 lines
709 B
JavaScript
Raw Normal View History

2015-02-06 00:23:26 -06:00
google.setOnLoadCallback(drawChart);
function drawChart() {
2015-05-16 02:57:31 -05:00
googleLineChart('chart/account/frontpage', 'accounts-chart');
googlePieChart('chart/bill/frontpage', 'bills-chart');
googleStackedColumnChart('chart/budget/frontpage', 'budgets-chart');
googleColumnChart('chart/category/frontpage', 'categories-chart');
2015-03-06 01:20:27 -06:00
getBoxAmounts();
}
function getBoxAmounts() {
var boxes = ['in', 'out', 'bills-unpaid', 'bills-paid'];
2015-03-06 01:20:27 -06:00
for (x in boxes) {
var box = boxes[x];
$.getJSON('/json/box/' + box).success(function (data) {
$('#box-' + data.box).html(data.amount);
2015-03-06 01:20:27 -06:00
}).fail(function () {
console.log('Failed to get box!')
});
}
2015-02-06 00:23:26 -06:00
}