mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Make some charts currency aware for #740
This commit is contained in:
6
public/js/ff/accounts/show.js
vendored
6
public/js/ff/accounts/show.js
vendored
@@ -35,9 +35,9 @@ $(function () {
|
||||
"use strict";
|
||||
lineChart(chartUri, 'overview-chart');
|
||||
if (!showAll) {
|
||||
pieChart(incomeCategoryUri, 'account-cat-in');
|
||||
pieChart(expenseCategoryUri, 'account-cat-out');
|
||||
pieChart(expenseBudgetUri, 'account-budget-out');
|
||||
neutralPieChart(incomeCategoryUri, 'account-cat-in');
|
||||
neutralPieChart(expenseCategoryUri, 'account-cat-out');
|
||||
neutralPieChart(expenseBudgetUri, 'account-budget-out');
|
||||
}
|
||||
|
||||
// sortable!
|
||||
|
14
public/js/ff/charts.defaults.js
vendored
14
public/js/ff/charts.defaults.js
vendored
@@ -129,4 +129,18 @@ var defaultPieOptions = {
|
||||
},
|
||||
maintainAspectRatio: true,
|
||||
responsive: true
|
||||
};
|
||||
|
||||
var neutralDefaultPieOptions = {
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
label: function (tooltipItem, data) {
|
||||
"use strict";
|
||||
var value = data.datasets[0].data[tooltipItem.index];
|
||||
return data.labels[tooltipItem.index] + ': ' + accounting.formatMoney(value, '¤');
|
||||
}
|
||||
}
|
||||
},
|
||||
maintainAspectRatio: true,
|
||||
responsive: true
|
||||
};
|
18
public/js/ff/charts.js
vendored
18
public/js/ff/charts.js
vendored
@@ -204,6 +204,8 @@ function columnChart(URI, container) {
|
||||
drawAChart(URI, container, chartType, options, colorData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param URI
|
||||
@@ -255,6 +257,22 @@ function pieChart(URI, container) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param URI
|
||||
* @param container
|
||||
*/
|
||||
function neutralPieChart(URI, container) {
|
||||
"use strict";
|
||||
|
||||
var colorData = false;
|
||||
var options = $.extend(true, {}, neutralDefaultPieOptions);
|
||||
var chartType = 'pie';
|
||||
|
||||
drawAChart(URI, container, chartType, options, colorData);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param URI
|
||||
|
Reference in New Issue
Block a user