Data Parameters
by Iqbal Kabir
HTML
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>
JavaScript
$(function() {
var names = ['Point 1', 'Point 2'];
var colors = ['#00FF00', '#FF00FF'];
var y = [1, 2]
var data1 = [];
for (i = 0; i <= 1; i++) {
obj = {
name: names[i],
color: colors[i],
y: y[i]
};
data1.push(obj);
}
console.log(colors.length)
$('#container').highcharts({
chart: {
type: 'column'
},
xAxis: {
categories: ['Green', 'Pink']
},
series: [{
data: data1
}]
});
});