updated by GasGit automation

This commit is contained in:
Bruce McPherson 2015-06-17 11:48:30 +01:00
parent c5ac4b7292
commit 45a5497c1a

View file

@ -16,9 +16,13 @@ var Sankey = (function(sankey) {
if(clear) {
chartElem.innerHTML = "";
}
// this might fail since we could pick up the data at any point - but that's ok
try {
// dont let the from and to field be the same
if (headers[0] === headers[1]) return;
// assuming the data is all clean here
var dataTable = new google.visualization.DataTable();
@ -26,6 +30,8 @@ var Sankey = (function(sankey) {
dataTable.addColumn ('string' , headers[1]);
dataTable.addColumn ('number' , headers[2]);
// assign data - be lenient with mismatched data types
dataTable.addRows(data.map(function(d) {
return [d[0].toString(), d[1].toString() , parseInt (d[2],10)];