2016-12-10 06:50:13 +01:00
|
|
|
/*
|
|
|
|
|
* month.js
|
2019-10-02 06:43:38 +02:00
|
|
|
* Copyright (c) 2019 thegrumpydictator@gmail.com
|
2016-12-10 06:50:13 +01:00
|
|
|
*
|
2019-10-02 06:43:38 +02:00
|
|
|
* This file is part of Firefly III (https://github.com/firefly-iii).
|
2016-12-10 06:50:13 +01:00
|
|
|
*
|
2019-10-02 06:43:38 +02:00
|
|
|
* 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
|
|
|
*
|
2019-10-02 06:43:38 +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
|
2019-10-02 06:43:38 +02:00
|
|
|
* GNU Affero General Public License for more details.
|
2017-10-21 08:40:00 +02:00
|
|
|
*
|
2019-10-02 06:43:38 +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/>.
|
2016-12-10 06:50:13 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
"use strict";
|
|
|
|
|
drawChart();
|
|
|
|
|
|
2019-09-02 16:52:35 +02:00
|
|
|
loadAjaxPartial('accountsHolder', accountsUri);
|
|
|
|
|
loadAjaxPartial('budgetsHolder', budgetsUri);
|
|
|
|
|
loadAjaxPartial('accountPerbudgetHolder', accountPerBudgetUri);
|
|
|
|
|
|
2019-09-02 20:30:47 +02:00
|
|
|
loadAjaxPartial('topExpensesHolder', topExpensesUri);
|
|
|
|
|
loadAjaxPartial('avgExpensesHolder', avgExpensesUri);
|
2019-09-02 16:52:35 +02:00
|
|
|
|
2016-12-10 06:50:13 +01:00
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function drawChart() {
|
|
|
|
|
"use strict";
|
|
|
|
|
|
2019-09-02 20:30:47 +02:00
|
|
|
$.each($('.main_budget_canvas'), function (i, v) {
|
|
|
|
|
var canvas = $(v);
|
|
|
|
|
columnChart(canvas.data('url'), canvas.attr('id'));
|
|
|
|
|
});
|
2016-12-10 06:50:13 +01:00
|
|
|
|
|
|
|
|
// draw pie chart of income, depending on "show other transactions too":
|
2016-12-16 08:07:31 +01:00
|
|
|
redrawPieChart('budgets-out-pie-chart', budgetExpenseUri);
|
2019-09-02 20:30:47 +02:00
|
|
|
redrawPieChart('categories-out-pie-chart', categoryExpenseUri);
|
|
|
|
|
redrawPieChart('source-accounts-pie-chart', sourceExpenseUri);
|
|
|
|
|
redrawPieChart('dest-accounts-pie-chart', destinationExpenseUri);
|
2016-12-10 06:50:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function redrawPieChart(container, uri) {
|
|
|
|
|
"use strict";
|
2019-09-02 20:30:47 +02:00
|
|
|
multiCurrencyPieChart(uri, container);
|
2016-12-10 06:50:13 +01:00
|
|
|
}
|