Commit da245076 authored by Mathieu Giraud's avatar Mathieu Giraud
Browse files

js/*_axis.js: extract 'sortValueMapping' to GenericAxis

Follows 5206c45d.
parent cc0c6bad
......@@ -136,6 +136,15 @@ GenericAxis.prototype = {
}
},
sortValueMapping: function() {
var temp = {}
for (var key_pos in Object.keys(this.value_mapping).sort()){
key = Object.keys(this.value_mapping).sort()[key_pos]
temp[key] = this.value_mapping[key]
}
this.value_mapping = temp
},
applyConverter: function(value) {
var val;
try {
......
......@@ -297,12 +297,7 @@ FloatAxis.prototype = Object.create(NumericalAxis.prototype);
}
}
}
var temp = {}
var sorted_keys = Object.keys(this.value_mapping).sort()
for (var key_pos in sorted_keys){
key = sorted_keys[key_pos]
temp[key] = this.value_mapping[key]
}
this.value_mapping = temp
this.sortValueMapping()
}
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