mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
Merge pull request #8434 from elastic/jasper/backport/8372/5.0
[backport] PR #8372 to 5.0
This commit is contained in:
commit
080fb1d49b
6 changed files with 38 additions and 2 deletions
|
@ -116,14 +116,23 @@ export default function HandlerBaseClass(Private) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// render the chart(s)
|
// render the chart(s)
|
||||||
selection.selectAll('.chart')
|
let loadedCount = 0;
|
||||||
.each(function (chartData) {
|
const chartSelection = selection.selectAll('.chart');
|
||||||
|
chartSelection.each(function (chartData) {
|
||||||
const chart = new self.ChartClass(self, this, chartData);
|
const chart = new self.ChartClass(self, this, chartData);
|
||||||
|
|
||||||
self.vis.activeEvents().forEach(function (event) {
|
self.vis.activeEvents().forEach(function (event) {
|
||||||
self.enable(event, chart);
|
self.enable(event, chart);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
chart.events.on('rendered', () => {
|
||||||
|
loadedCount++;
|
||||||
|
if (loadedCount === chartSelection.length) {
|
||||||
|
// events from all charts are propagated to vis, we only need to fire renderComplete on one (first)
|
||||||
|
charts[0].events.emit('renderComplete');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
charts.push(chart);
|
charts.push(chart);
|
||||||
chart.render();
|
chart.render();
|
||||||
});
|
});
|
||||||
|
|
|
@ -211,6 +211,17 @@ export default function MapFactory(Private, tilemap, $sanitize) {
|
||||||
|
|
||||||
this._tileLayer.on('tileload', saturateTiles);
|
this._tileLayer.on('tileload', saturateTiles);
|
||||||
|
|
||||||
|
this._tileLayer.on('load', () => {
|
||||||
|
if (!self._events) return;
|
||||||
|
|
||||||
|
self._events.emit('rendered', {
|
||||||
|
chart: self._chartData,
|
||||||
|
map: self.map,
|
||||||
|
center: self._mapCenter,
|
||||||
|
zoom: self._mapZoom,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
this.map.on('unload', function () {
|
this.map.on('unload', function () {
|
||||||
self._tileLayer.off('tileload', saturateTiles);
|
self._tileLayer.off('tileload', saturateTiles);
|
||||||
});
|
});
|
||||||
|
|
|
@ -365,6 +365,10 @@ export default function AreaChartFactory(Private) {
|
||||||
timeMarker.render(svg);
|
timeMarker.render(svg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.events.emit('rendered', {
|
||||||
|
chart: data
|
||||||
|
});
|
||||||
|
|
||||||
return svg;
|
return svg;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -315,6 +315,10 @@ export default function ColumnChartFactory(Private) {
|
||||||
timeMarker.render(svg);
|
timeMarker.render(svg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.events.emit('rendered', {
|
||||||
|
chart: data
|
||||||
|
});
|
||||||
|
|
||||||
return svg;
|
return svg;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -339,6 +339,10 @@ export default function LineChartFactory(Private) {
|
||||||
timeMarker.render(svg);
|
timeMarker.render(svg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.events.emit('rendered', {
|
||||||
|
chart: data
|
||||||
|
});
|
||||||
|
|
||||||
return svg;
|
return svg;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -202,6 +202,10 @@ export default function PieChartFactory(Private) {
|
||||||
const path = self.addPath(width, height, svg, slices);
|
const path = self.addPath(width, height, svg, slices);
|
||||||
self.addPathEvents(path);
|
self.addPathEvents(path);
|
||||||
|
|
||||||
|
self.events.emit('rendered', {
|
||||||
|
chart: data
|
||||||
|
});
|
||||||
|
|
||||||
return svg;
|
return svg;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue