I'm using c3.js for graphing and everything is working as expected.
However, I'd like to access the API from other scripts, that is call resize
etc...
if I use:
var chart = c3.generate({ ... });
I can then access the chart object and it's API like:
chart.resize();
However, if I do not have access to the chart object as it's another script I can get the HTML DOM element (using jQuery):
$(".c3").each(function(i, chart) {
// Here I want to do something like chart.resize();
// But chart is just the DOM reference, not the chart variable
// I need something like c3.get(chart)????
});
But chart
in the loop is a DOM object, not the var chart
made from c3.generate
.
Any ideas how I can get this object? The documentation isn't quite finished ;)