Files
firefly-iii/public/v1/js/ff/reports/budget/month.js

57 lines
1.8 KiB
JavaScript
Raw Normal View History

/*
* month.js
2020-02-16 13:59:41 +01:00
* Copyright (c) 2019 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
2017-10-21 08:40:00 +02:00
*
* This program is distributed in the hope that it will be useful,
2017-10-21 08:40:00 +02:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
2017-10-21 08:40:00 +02:00
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
$(function () {
"use strict";
drawChart();
2022-04-12 18:19:30 +02:00
loadAjaxPartial('accountsHolder', accountsUrl);
loadAjaxPartial('budgetsHolder', budgetsUrl);
loadAjaxPartial('accountPerbudgetHolder', accountPerBudgetUrl);
2022-04-12 18:19:30 +02:00
loadAjaxPartial('topExpensesHolder', topExpensesUrl);
loadAjaxPartial('avgExpensesHolder', avgExpensesUrl);
});
function drawChart() {
"use strict";
$.each($('.main_budget_canvas'), function (i, v) {
var canvas = $(v);
columnChart(canvas.data('url'), canvas.attr('id'));
});
// draw pie chart of income, depending on "show other transactions too":
2022-04-12 18:19:30 +02:00
redrawPieChart('budgets-out-pie-chart', budgetExpenseUrl);
redrawPieChart('categories-out-pie-chart', categoryExpenseUrl);
redrawPieChart('source-accounts-pie-chart', sourceExpenseUrl);
redrawPieChart('dest-accounts-pie-chart', destinationExpenseUrl);
}
2022-04-12 18:19:30 +02:00
function redrawPieChart(container, url) {
"use strict";
2022-04-12 18:19:30 +02:00
multiCurrencyPieChart(url, container);
}