fix duplicate chart title (#11594) (#11692)

* fix duplicate chart title

* updating el to axisWrapperElement
This commit is contained in:
Peter Pisljar 2017-05-10 18:32:25 +02:00 committed by GitHub
parent acb42de8fc
commit 07916f0c2f

View file

@ -71,23 +71,23 @@ export function VislibLibLayoutLayoutProvider(Private) {
const position = axis.axisConfig.get('position');
const chartTitle = new ChartTitle(visConfig);
const el = $(this.el).find(`.axis-wrapper-${position}`);
const axisWrapperElement = $(this.el).find(`.axis-wrapper-${position}`);
el.css('visibility', 'hidden');
axisWrapperElement.css('visibility', 'hidden');
axis.render();
chartTitle.render();
const width = el.width();
const height = el.height();
const width = axisWrapperElement.width();
const height = axisWrapperElement.height();
axis.destroy();
el.find('.chart-title svg').remove();
el.css('visibility', '');
$(this.el).find('.chart-title svg').remove();
axisWrapperElement.css('visibility', '');
if (axis.axisConfig.isHorizontal()) {
const spacerNodes = $(this.el).find(`.y-axis-spacer-block-${position}`);
spacerNodes.height(`${height}px`);
} else {
el.find('.y-axis-div-wrapper').width(`${width}px`);
axisWrapperElement.find('.y-axis-div-wrapper').width(`${width}px`);
}
}