This should redisplay every month changing the title to each month... It only shows January, then February.
why is this
Please help
Much appreciated and will be compensated.
Code
<script>
$(document).ready(function() {
var data1 = {
chart : {
type : 'column',
plotBackgroundImage: "lottographs_background.bmp"
},
title : {
text : "January's Picks"
},
xAxis : {
dateTimeLabelFormats: {
month: '%B'
},
categories : [ '1', '2','3','4','5','6','7','8','9','10','11','12','13',
'14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30','31','32','33',
'34','35','36','37','38','39','40' ]
},
yAxis : {
title : {
text : 'Numbers'
}
},
series : [ {
name : 'January',
data : [ 10, 24, 2,5,11,13,54,2,62,22,2,12,21,2,25,52,15,15,16,17,18,20,31,23,12,13,14,15,16,11,17,18,44,3,5,6,7,4,5,3 ],
color: '#FFFF00'
}, ]};
//call it once
myFunction(data1);
// change some of the data
for ( var i = 1; i < 13; i++ ) {
if (i = 1){
setTimeout(function() {
myFunction(data1);
}, 3000)
data1.title.text="February's Picks";
break;
}
else if (i = 2){
setTimeout(function() {
myFunction(data1);
}, 3000)
data1.title.text="March's Picks";
break;
}
else if (i = 3) {
setTimeout(function() {
myFunction(data1);
}, 3000)
data1.title.text="April's Picks";
break;
}
else if (i = 4){
setTimeout(function() {
myFunction(data1);
}, 3000)
data1.title.text="May's Picks";
break;
}
else if (i = 5){
setTimeout(function() {
myFunction(data1);
}, 3000)
data1.title.text="June's Picks";
break;
}
}
});
function myFunction(data1) {
$('#container').highcharts(data1);
}