Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ describe('Vislib Heatmap Chart Test Suite', function () {
vis.destroy();
});

it('category axes should be rendered in reverse order', () => {
const renderedCategoryAxes = vis.handler.renderArray.filter(item => {
return item.constructor && item.constructor.name === 'Axis' && item.axisConfig.get('type') === 'category';
});
expect(vis.handler.categoryAxes.length).to.equal(renderedCategoryAxes.length);
expect(vis.handler.categoryAxes[0].axisConfig.get('id')).to.equal(renderedCategoryAxes[1].axisConfig.get('id'));
expect(vis.handler.categoryAxes[1].axisConfig.get('id')).to.equal(renderedCategoryAxes[0].axisConfig.get('id'));
});

describe('addSquares method', function () {
it('should append rects', function () {
vis.handler.charts.forEach(function (chart) {
Expand Down
3 changes: 2 additions & 1 deletion src/ui/public/vislib/lib/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export function VisHandlerProvider(Private) {

this.renderArray = this.renderArray
.concat(this.valueAxes)
.concat(this.categoryAxes);
// category axes need to render in reverse order https://github.com/elastic/kibana/issues/13551
.concat(this.categoryAxes.slice().reverse());

// memoize so that the same function is returned every time,
// allowing us to remove/re-add the same function
Expand Down