title: How to get object reference from selector for C3 JS charts
body: <p>I'm using <a href="http://c3js.org/" rel="noreferrer">c3.js</a> for graphing and everything is working as expected.</p>
  
  <p>However, I'd like to access the API from other scripts, that is call <code>resize</code> etc...</p>
  
  <p>if I use:</p>
  
  <pre><code>var chart = c3.generate({ ... });
  </code></pre>
  
  <p>I can then access the chart object and it's API like:</p>
  
  <pre><code>chart.resize();
  </code></pre>
  
  <p>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):</p>
  
  <pre><code>$(".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)????
  });
  </code></pre>
  
  <p>But <code>chart</code> in the loop is a DOM object, not the <code>var chart</code> made from <code>c3.generate</code>.</p>
  
  <p>Any ideas how I can get this object? The documentation isn't quite finished ;)</p>