mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
fixing charts to not render twice
This commit is contained in:
parent
cd4e1dc7de
commit
f7f0f12439
3 changed files with 12 additions and 1 deletions
|
@ -182,6 +182,10 @@ export default function ResizeCheckerFactory(Private, Notifier) {
|
|||
}, ms));
|
||||
};
|
||||
|
||||
ResizeChecker.prototype.stopSchedule = function () {
|
||||
clearTimeout(this._timerId);
|
||||
};
|
||||
|
||||
/**
|
||||
* Signal that the ResizeChecker should shutdown.
|
||||
*
|
||||
|
|
|
@ -64,8 +64,12 @@ export default function VisFactory(Private) {
|
|||
uiState.on('change', this._uiStateChangeHandler = () => this.render(this.data, this.uiState));
|
||||
}
|
||||
|
||||
this.resizeChecker.stopSchedule();
|
||||
this.handler = handlerTypes[chartType](this) || handlerTypes.column(this);
|
||||
this._runOnHandler('render');
|
||||
this.resizeChecker.saveSize();
|
||||
this.resizeChecker.saveDirty(false);
|
||||
this.resizeChecker.continueSchedule();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -46,7 +46,10 @@ module.exports = function VislibRenderbotFactory(Private) {
|
|||
VislibRenderbot.prototype.buildChartData = buildChartData;
|
||||
VislibRenderbot.prototype.render = function (esResponse) {
|
||||
this.chartData = this.buildChartData(esResponse);
|
||||
this.vislibVis.render(this.chartData, this.uiState);
|
||||
// to allow legend to render first
|
||||
setTimeout(() => {
|
||||
this.vislibVis.render(this.chartData, this.uiState);
|
||||
});
|
||||
};
|
||||
|
||||
VislibRenderbot.prototype.destroy = function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue