C3 Graphs On Load Callback

c3.js, d3.js, html, javascript, jquery

Solution

Don't load any data in the initialization. Rather explicitly call the load event and pass the data in. Then you have access to the `done` callback.

var chart = c3.generate({ /*...*/ });

chart.load({
  columns: [['data1, 100, 200, 150, ...],
    ...
  ],
  done: function() { /* whatever you need done here... */}
});

Problem

I want to use some kind of callback function that will run some code once the C3 Graph is finished loading so that I can change the fill colors of certain points.

Original source