chg: filter out null value in array

megaRefact
Sami Mokaddem 2018-08-22 07:38:02 +00:00
parent 9e657ea415
commit aca58eb9e7
2 changed files with 3 additions and 7 deletions

View File

@ -16,14 +16,8 @@
fillValue: 0
};
this.options = $.extend({}, this._default_options, options);
//this.result = {
// dates: [],
//};
this.result = {};
//for (var k in this.mapping) {
// this.result[k] = [];
//}
this.result.dates = [];
this.mappingDate = {};
@ -43,6 +37,9 @@
}
if (this.mapping.labels.length > 0 && this.mapping.values.length > 0) {
this.c_values(this.data, this.mapping.labels); // fetch values and overwrite default values
for (var k in this.result) {
this.result[k] = this.result[k].filter(function(n){ return n != undefined });
}
}
},

View File

@ -11,7 +11,6 @@
var TreeFromJson = function(container, data, options) {
this.container = container;
console.log(container.width());
this._default_options = {
margin: {top: 20, right: 20, bottom: 20, left: 20},
width: container.width() > 800 ? container.width()/2 : 800,