firefly-iii/public/js/index.js

25 lines
741 B
JavaScript
Raw Normal View History

2015-02-06 00:23:26 -06:00
google.setOnLoadCallback(drawChart);
function drawChart() {
googleLineChart('chart/home/account', 'accounts-chart');
2015-03-06 01:20:27 -06:00
googleBarChart('chart/home/budgets', 'budgets-chart');
googleColumnChart('chart/home/categories', 'categories-chart');
googlePieChart('chart/home/bills', 'bills-chart');
getBoxAmounts();
}
function getBoxAmounts() {
var boxes = ['in', 'out','bills-unpaid','bills-paid'];
for (x in boxes) {
var box = boxes[x];
$.getJSON('/json/box', {box: box}).success(function (data) {
2015-03-07 05:34:03 -06:00
if(data.amount_raw != 0) {
$('#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
}