C3 plots on load callback
2 answers
Don't load data into initialization. Rather, explicitly call the load event and pass the data. Then you have access to the postback done
.
var chart = c3.generate({ /*...*/ });
chart.load({
columns: [['data1, 100, 200, 150, ...],
...
],
done: function() { /* whatever you need done here... */}
});
+4
source to share
Try to declare the id
graph container (usually svg
) with .attr("id", "GraphContainer")
. After that, you can bind to it .onload
. Something like that:
var SVGCont = document.getElementById("GraphContainer");
SVGCont.onload = function() {
// your code for when it done loading
};
You can also use an event when SVG elements are added to the DOM:
$(document).bind("DOMNodeInserted", function(e) {
// your code
});
0
source to share