title: C3.js create a chart by getting the data from external API
body: <p>I am trying to create a chart in c3.js and my data is coming from an external API. I want to get the data and the keys from the json data so that I can plot the values on the chart. I have added the external api format and the js code below.</p>
  
  <p><strong>JSON DATA:</strong></p>
  
  <pre><code>[{ 
        "label" : "A Label" ,
        "value" : -29.765957771107
      } , 
      { 
        "label" : "B Label" , 
        "value" : 0
      } , 
      { 
        "label" : "C Label" , 
        "value" : 32.807804682612
      } , 
      { 
        "label" : "D Label" , 
        "value" : 196.45946739256
      }]
  </code></pre>
  
  <p><strong>JS Code:</strong> </p>
  
  <pre><code>d3.json("http://localhost:8080/api/study", function(data) {
      var chart = c3.generate({
          bindto : '#chartContainer',
          data : {
              columns : ['label']
          },
           keys: {
              x: 'label',
              value: ['value']
          }
      });
  });
  </code></pre>
  
  <p>Thank You</p>