diff --git a/src/kibana/components/vislib/components/zero_injection/ordered_x_keys.js b/src/kibana/components/vislib/components/zero_injection/ordered_x_keys.js index c5ee031603a7f..a9d09590fe1a9 100644 --- a/src/kibana/components/vislib/components/zero_injection/ordered_x_keys.js +++ b/src/kibana/components/vislib/components/zero_injection/ordered_x_keys.js @@ -17,6 +17,11 @@ define(function (require) { return _.chain(objKeys) .pairs() + .sortBy(function (d) { + + // sort by index + return d[1].index; + }) .map(function (d) { return d[1].isNumber ? +d[0] : d[0]; }) diff --git a/src/kibana/components/vislib/components/zero_injection/uniq_keys.js b/src/kibana/components/vislib/components/zero_injection/uniq_keys.js index f8be5e505de73..89b5d1168430a 100644 --- a/src/kibana/components/vislib/components/zero_injection/uniq_keys.js +++ b/src/kibana/components/vislib/components/zero_injection/uniq_keys.js @@ -21,6 +21,7 @@ define(function (require) { flattenedData.forEach(function (d, i) { var key = d.x; + console.log(d.x, i); if (uniqueXValues[key] === void 0) { uniqueXValues[key] = {