diff --git a/public/js/ff/charts.js b/public/js/ff/charts.js index 35b99f0b00..fa0c8f049a 100644 --- a/public/js/ff/charts.js +++ b/public/js/ff/charts.js @@ -75,7 +75,7 @@ function lineChart(URI, container) { "use strict"; var colorData = true; - var options = defaultChartOptions; + var options = $.extend(true, {}, defaultChartOptions); var chartType = 'line'; drawAChart(URI, container, chartType, options, colorData); @@ -188,7 +188,7 @@ function columnChart(URI, container) { "use strict"; console.log('Going to draw column chart for ' + URI + ' in ' + container); var colorData = true; - var options = defaultChartOptions; + var options = $.extend(true, {}, defaultChartOptions); var chartType = 'bar'; drawAChart(URI, container, chartType, options, colorData); @@ -224,7 +224,7 @@ function pieChart(URI, container) { "use strict"; var colorData = false; - var options = defaultPieOptions; + var options = $.extend(true, {}, defaultPieOptions); var chartType = 'pie'; drawAChart(URI, container, chartType, options, colorData); diff --git a/public/js/ff/reports/category/month.js b/public/js/ff/reports/category/month.js index 84f3444d9b..e803ff3de7 100644 --- a/public/js/ff/reports/category/month.js +++ b/public/js/ff/reports/category/month.js @@ -15,19 +15,19 @@ $(function () { drawChart(); $('#categories-in-pie-chart-checked').on('change', function () { - redrawPieChart('categories-in-pie-chart', categoryIncomeUri); + redrawPieChart(categoryIncomeUri, 'categories-in-pie-chart'); }); $('#categories-out-pie-chart-checked').on('change', function () { - redrawPieChart('categories-out-pie-chart', categoryExpenseUri); + redrawPieChart(categoryExpenseUri, 'categories-out-pie-chart'); }); $('#accounts-in-pie-chart-checked').on('change', function () { - redrawPieChart('accounts-in-pie-chart', accountIncomeUri); + redrawPieChart(accountIncomeUri, 'accounts-in-pie-chart'); }); $('#accounts-out-pie-chart-checked').on('change', function () { - redrawPieChart('accounts-out-pie-chart', accountExpenseUri); + redrawPieChart(accountExpenseUri, 'accounts-out-pie-chart'); }); }); @@ -40,15 +40,17 @@ function drawChart() { doubleYChart(mainUri, 'in-out-chart'); // draw pie chart of income, depending on "show other transactions too": - redrawPieChart('categories-in-pie-chart', categoryIncomeUri); - redrawPieChart('categories-out-pie-chart', categoryExpenseUri); - redrawPieChart('accounts-in-pie-chart', accountIncomeUri); - redrawPieChart('accounts-out-pie-chart', accountExpenseUri); + redrawPieChart(categoryIncomeUri, 'categories-in-pie-chart'); + redrawPieChart(categoryExpenseUri, 'categories-out-pie-chart'); + redrawPieChart(accountIncomeUri, 'accounts-in-pie-chart'); + redrawPieChart(accountExpenseUri, 'accounts-out-pie-chart'); + stackedColumnChart(expenseAccountTimeUri, 'expense-time-chart'); + stackedColumnChart(revenueAccountTimeUri, 'revenue-time-chart'); } -function redrawPieChart(container, uri) { +function redrawPieChart(uri, container) { "use strict"; var checkbox = $('#' + container + '-checked');