Commit 254652b0 authored by Francisco Jesús Acién Pérez's avatar Francisco Jesús Acién Pérez
Browse files

set to unknown when there is no source

parent 9506ba16
Pipeline #1562 passed with stages
in 12 seconds
...@@ -542,7 +542,15 @@ Data can be provided in one of three ways: ...@@ -542,7 +542,15 @@ Data can be provided in one of three ways:
if (this.rows && this.rows.length > 0 && this.cols && if (this.rows && this.rows.length > 0 && this.cols &&
this.cols.length > 0) { this.cols.length > 0) {
// Create the data table from cols and rows. // Create the data table from cols and rows.
// console.log(data)
//Check that there are not undefined elements
// If exists set it to unknown
for(var i = 0; i < this.rows.length ; i++){
if(this.rows[i][0] == undefined){
this.rows[i][0] = "Unknown";
}
}
dataTable = new google.visualization.DataTable(); dataTable = new google.visualization.DataTable();
dataTable.cols = this.cols; dataTable.cols = this.cols;
for (var i = 0; i < this.cols.length; i++) { for (var i = 0; i < this.cols.length; i++) {
...@@ -573,7 +581,6 @@ Data can be provided in one of three ways: ...@@ -573,7 +581,6 @@ Data can be provided in one of three ways:
// There is an error when rows have not the same length, we have to // There is an error when rows have not the same length, we have to
// delete unnecesary data from rows (undefined values) // delete unnecesary data from rows (undefined values)
var numCols = 0; var numCols = 0;
for(; this.rows[0][numCols] != undefined; numCols++); for(; this.rows[0][numCols] != undefined; numCols++);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment