mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-15 19:09:50 +00:00
Removed some charts, removed lots of dead code.
This commit is contained in:
@@ -3,10 +3,5 @@ $(function () {
|
||||
if (typeof(googleLineChart) == "function" && typeof accountID != 'undefined' && typeof view != 'undefined') {
|
||||
googleLineChart('chart/account/' + accountID + '/' + view, 'overview-chart');
|
||||
}
|
||||
//
|
||||
if (typeof(googleSankeyChart) == 'function' && typeof accountID != 'undefined' && typeof view != 'undefined') {
|
||||
googleSankeyChart('chart/sankey/' + accountID + '/out' + '/' + view, 'account-out-sankey');
|
||||
googleSankeyChart('chart/sankey/' + accountID + '/in' + '/' + view, 'account-in-sankey');
|
||||
}
|
||||
|
||||
});
|
||||
@@ -224,43 +224,3 @@ function googlePieChart(URL, container, options) {
|
||||
console.log('No container found called "' + container + '"');
|
||||
}
|
||||
}
|
||||
|
||||
function googleSankeyChart(URL, container, options) {
|
||||
if ($('#' + container).length == 1) {
|
||||
$.getJSON(URL).success(function (data) {
|
||||
/*
|
||||
Get the data from the JSON
|
||||
*/
|
||||
gdata = new google.visualization.DataTable(data);
|
||||
|
||||
/*
|
||||
Format as money
|
||||
*/
|
||||
|
||||
if (gdata.getNumberOfRows() < 1) {
|
||||
$('#' + container).parent().parent().remove();
|
||||
return;
|
||||
} else if (gdata.getNumberOfRows() < 6) {
|
||||
defaultSankeyChartOptions.height = 100
|
||||
} else {
|
||||
defaultSankeyChartOptions.height = 400
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Create a new google charts object.
|
||||
*/
|
||||
var chart = new google.visualization.Sankey(document.getElementById(container));
|
||||
|
||||
/*
|
||||
Draw it:
|
||||
*/
|
||||
chart.draw(gdata, options || defaultSankeyChartOptions);
|
||||
|
||||
}).fail(function () {
|
||||
$('#' + container).addClass('google-chart-error');
|
||||
});
|
||||
} else {
|
||||
console.log('No container found called "' + container + '"');
|
||||
}
|
||||
}
|
||||
@@ -136,6 +136,3 @@ var defaultPieChartOptions = {
|
||||
colors: ["#4285f4", "#db4437", "#f4b400", "#0f9d58", "#ab47bc", "#00acc1", "#ff7043", "#9e9d24", "#5c6bc0", "#f06292", "#00796b", "#c2185b"]
|
||||
};
|
||||
|
||||
var defaultSankeyChartOptions = {
|
||||
height: 400
|
||||
}
|
||||
Reference in New Issue
Block a user