Commit ecc6cd31 authored by Mathieu Giraud's avatar Mathieu Giraud

js/{generic,numerical}_axis.js: be more robust on undefined values

parent ca165b58
......@@ -127,7 +127,7 @@ GenericAxis.prototype = {
if (typeof round !== 'undefined')
convert = nice_ceil(convert - round/2, round)
if (typeof convert == "undefined" || convert == undefined || convert == "undefined") {
if (typeof convert == "undefined" || convert == undefined || convert == "undefined" || Number.isNaN(convert)) {
if (this.can_undefined) {
if (typeof this.value_mapping["?"] === 'undefined')
this.value_mapping["?"] = [];
......@@ -235,7 +235,8 @@ GenericAxis.prototype = {
computeBarTab: function(ref) {
ref.barTab = {};
for (var key in this.value_mapping) {
ref.barTab[key] = this.value_mapping[key];
var vkey = (typeof key == 'undefined') ? '?' : key
ref.barTab[vkey] = this.value_mapping[key];
}
},
......
......@@ -152,7 +152,7 @@ NumericalAxis.prototype = Object.create(GenericAxis.prototype);
NumericalAxis.prototype.pos_from_value = function(value) {
if (typeof value != "undefined" && value != 'undefined'){
if (typeof value != "undefined" && value != 'undefined' && value != "?"){
pos = this.sizeScale(value);
}else{
pos = this.sizeScale(this.use_log ? this.min : this.max) ;
......
Markdown is supported
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