frappe / charts

Simple, responsive, modern SVG Charts with zero dependencies
https://frappe.io/charts
MIT License
14.9k stars 716 forks source link

Promise or event for render complete? #421

Open casesolved-co-uk opened 2 months ago

casesolved-co-uk commented 2 months ago

Please can someone tell me if the render process is a Promise or if there is an event for its completion?

I need to screenshot an ERPNext dashboard (multiple charts) so need to know when all the charts have completed rendering.

TIA

@uhrjun ?

casesolved-co-uk commented 2 months ago

It seems an event should be triggered when updateNav is run?

I think adding a Promise would be too difficult because charts are rendered directly from the constructor, so no chance to return something... Unless base chart subclasses promise?

https://github.com/frappe/charts/blob/f33309601201776c9f724e46badadaeef4663358/src/js/charts/BaseChart.js#L313