Removed some charts, removed lots of dead code.

This commit is contained in:
James Cole
2014-12-13 20:03:44 +01:00
parent 9ab0a83f7c
commit c77b43458e
66 changed files with 197 additions and 9222 deletions

View File

@@ -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');
}
});

View File

@@ -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 + '"');
}
}

View File

@@ -136,6 +136,3 @@ var defaultPieChartOptions = {
colors: ["#4285f4", "#db4437", "#f4b400", "#0f9d58", "#ab47bc", "#00acc1", "#ff7043", "#9e9d24", "#5c6bc0", "#f06292", "#00796b", "#c2185b"]
};
var defaultSankeyChartOptions = {
height: 400
}