Hello,
I know, this is not a question at ionic framework, but somebody know how to handle this.
I use echarts for echarting. animation is set to false To get a png from echarts I can call
chart.getDataURL({
type: 'png',
pixelRatio: 2,
backgroundColor: bgColor,
excludeComponents: ['toolbox', 'dataZoom']
});
works great as long the chart needs not to long to render otherwise the png is taken before the charts has rendert fully.
echarts offers an event (code from documetation)
chart.on('finished', function () {
snapshotImage.src = chart.getDataURL();
});
I loop over several charts to get the getDataURL() and put in a pdf.
So my question how can I wait that rendering is finished like
getimage(): string {
wait for is chart.on('finished...);
return chart.getDataURL();
}
Any ideas
Thanks in advance, anna-liebt