I've generated an array (myData) using a for loop and saved it in a variable, but I'm having trouble displaying the data with highcharts.
For testing purposes, I created another array (arr) with numbers manually and it worked fine when I used that array instead.
Check out the example at http://jsfiddle.net/o22uk7Lb/
HTML
myData<p id="demo"></p>
arr<p id="demo2"></p>
<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
Javascript
var mp = 300;
var yp = (mp * 12);
var year = new Array(12);
var myData = [];
for (var i = 1; i <= 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
},]
})