updated by GasGit automation
This commit is contained in:
parent
c5ac4b7292
commit
45a5497c1a
1 changed files with 7 additions and 1 deletions
|
@ -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)];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue