2015-02-06 07:23:26 +01:00
|
|
|
google.setOnLoadCallback(drawChart);
|
|
|
|
|
|
|
|
|
|
|
|
function drawChart() {
|
2015-05-16 09:57:31 +02: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 08:20:27 +01:00
|
|
|
getBoxAmounts();
|
|
|
|
}
|
|
|
|
|
|
|
|
function getBoxAmounts() {
|
2015-04-11 07:24:07 +02:00
|
|
|
var boxes = ['in', 'out', 'bills-unpaid', 'bills-paid'];
|
2015-03-06 08:20:27 +01:00
|
|
|
for (x in boxes) {
|
|
|
|
var box = boxes[x];
|
2015-04-11 07:24:07 +02:00
|
|
|
$.getJSON('/json/box/' + box).success(function (data) {
|
2015-05-03 08:56:44 +02:00
|
|
|
$('#box-' + data.box).html(data.amount);
|
2015-03-06 08:20:27 +01:00
|
|
|
}).fail(function () {
|
|
|
|
console.log('Failed to get box!')
|
|
|
|
});
|
|
|
|
}
|
2015-02-06 07:23:26 +01:00
|
|
|
}
|