Quick links.

This commit is contained in:
James Cole
2015-12-15 12:38:18 +01:00
parent 0303b45707
commit 301528e2d2
7 changed files with 98 additions and 13 deletions

View File

@@ -8,7 +8,6 @@ $(function () {
});
function drawChart() {
"use strict";
@@ -17,10 +16,30 @@ function drawChart() {
columnChart('chart/report/in-out-sum/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds, 'income-expenses-sum-chart');
$.each($('.account-chart'), function(i,v) {
$.each($('.account-chart'), function (i, v) {
var holder = $(v);
console.log(holder.data('id'));
console.log('Will draw chart for account #' + holder.data('id'));
});
// draw budget chart based on selected budgets:
$('.budget-checkbox').on('change', updateBudgetChart);
}
function updateBudgetChart(e) {
console.log('will update budget chart.');
// get all budget ids:
var budgets = [];
$.each($('.budget-checkbox'), function (i, v) {
var current = $(v);
if (current.prop('checked')) {
budgets.push(current.val());
}
});
var budgetIds = budgets.join(',');
// draw chart. Redraw when exists? Not sure if we support that.
columnChart('chart/budget/multi-year/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds + '/' + budgetIds, 'budgets-chart');
}

View File

@@ -64,7 +64,7 @@ function catchSubmit() {
$.each($('.account-checkbox'), function (i, v) {
var c = $(v);
if (c.prop('checked')) {
url += c.val() + ';';
url += c.val() + ',';
accounts.push(c.val());
count++;
}