novus / nvd3

A reusable charting library written in d3.js
http://nvd3.org/
Other
7.22k stars 2.15k forks source link

How to check if chart is already rendered? #2204

Open Marco-Sulla opened 5 years ago

Marco-Sulla commented 5 years ago

I'm using nv.models.multiBarChart and I'm saving it to a global variable supplier_graph to use it outside.

I inspected the element and I see that, even if the chart is rendered, supplier_graph.multibar.__rendered is false. PS: I now it's a private variable, but I'm disperate :)

Background: I want to launch a function only when all the charts are rendered. supplier_graph.dispatch.on('renderEnd', supplierGraphRendered); works only if supplier_graph is not already rendered. If it's already rendered, I need to fire supplierGraphRendered() by hand.

How can I know if the chart is rendered?

PS: I have nvd3 version 1.8.6-dev and d3 version 3.4.2, but I checked also with 5.9.2 without success