function createCharts(datas) {
myChart.clear();
option = null;
var yearMonth = $("#curdate").text().split('-');
var day = new Date(yearMonth[0], yearMonth[1], 0).getDate();
//横坐标
var hours = new Array();
//纵坐标
var days = new Array();
for (var i = 0; i < 24; i++) {
hours.push(i + '时');
}
for (var i = 1; i <= day; i++) {
days.push(i + '日');
}
var data = null;
var newData = new Array();
for (var i = 0; i < datas.length; i++) {
data = new Array();
data.push(datas[i].TIME);
data.push(datas[i].NAME);
data.push(Number(datas[i].NUMBER));
newData.push(data);
}
newData = newData.map(function(item) {
alert(newData);
return [ item[0], item[1], item[2] || '-' ];
});
option = {
tooltip : {
position : 'top'
},
animation : false,
grid : {
height : '80%',
y : '2%',
x:'12%',
x2:'1%'
},
xAxis : {
type : 'category',
data : hours,
splitArea : {
show : true
}
},
yAxis : {
type : 'category',
data : days,
splitArea : {
show : true
}
},
visualMap : {
min : 0,
max : 10,
calculable : true,