title: Pass array from js for loop to highcharts series data
body: <p>I've created an array (myData) from a for loop and stored it in a variable, however I'm unable to plot the data via highcharts.</p>
  
  <p>I've added an array (arr) containing numbers (i.e not via the for loop) to test and it works when using this array.</p>
  
  <p>Example in <a href="http://jsfiddle.net/o22uk7Lb/" rel="nofollow noreferrer">http://jsfiddle.net/o22uk7Lb/</a></p>
  
  <p>HTML</p>
  
  <pre><code>myData&lt;p id="demo"&gt;&lt;/p&gt;
  arr&lt;p id="demo2"&gt;&lt;/p&gt;
  
  &lt;div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Javascript</p>
  
  <pre><code>var mp = 300;
  var yp = (mp * 12);
  var year = new Array(12);
  var myData = [];
  for (var i = 1; i &lt;= year.length; i++){
      myData +=  (i * yp.toFixed(2)) + ",";
  };
  document.getElementById("demo").innerHTML = myData; 
  
   var arr = [100,200,300,400,500];
   document.getElementById("demo2").innerHTML = arr; 
   Highcharts.chart('container', {
      chart: {
          type: 'column'
      },
  
      plotOptions: {
          bar: {
              dataLabels: {
                  enabled: true
              }
          }
      },
      series: [{
          data: myData
      },]
   })
  </code></pre>