title: How to set label in dataPoints chart on javascript?
body: <p>I want to make chart and set the label and value from database. I already get the data and convert to json object.
  this is the default script to set the label ,</p>
  
  <pre><code>&lt;script&gt;
      window.onload = function () {
          var arrchartdata = JSON.parse('&lt;?php print $a;?&gt;');
  
  var options = {
      animationEnabled: true,
      title: {
          text: "GDP Growth Rate - 2016"
      },
      axisY: {
          title: "Growth Rate (in %)",
          suffix: "%",
          includeZero: false
      },
      axisX: {
          title: "Countries"
      },
      data: [{
          type: "column",
          yValueFormatString: "#,##0.0#"%"",
          dataPoints: [
          for (var i = 0; i &lt;arrchartdata.length ; i++) {
              console.log(arrchartdata[i].MenuName);
          }
          { label: arrchartdata[0].MenuName, y: 10.09 },  
          { label: "Turks &amp; Caicos Islands", y: 9.40 },   
          { label: "Nauru", y: 8.50 },
          { label: "Ethiopia", y: 7.96 }, 
          { label: "Uzbekistan", y: 7.80 },
          { label: "Nepal", y: 7.56 },
          { label: "Iceland", y: 7.20 },
          { label: "India", y: 7.1 }
  
          ]
      }]
  };
  $("#chartContainer").CanvasJSChart(options);
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I want to loop the label : arrchardata[0].MenuName, y : 10.09
  How i can do  it?
  I already tried for inside the data but it returns error.
  Any help would appreciated !</p>