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() {
|
2015-04-11 00:24:07 -05:00
|
|
|
var boxes = ['in', 'out', 'bills-unpaid', 'bills-paid'];
|
2015-03-06 01:20:27 -06:00
|
|
|
for (x in boxes) {
|
|
|
|
var box = boxes[x];
|
2015-04-11 00:24:07 -05:00
|
|
|
$.getJSON('/json/box/' + box).success(function (data) {
|
2015-05-03 01:56:44 -05:00
|
|
|
$('#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
|
|
|
}
|