我正在尝试创建一个图表,以显示每天的小时范围。换句话说,我想做这样的事情: http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/columnrange/,但有几小时的信息而不是温度。 我已经制作了这段代码(https://paste.maxux.net/x61fKlc),但系统没有绘制条形码。
有人可以解释一下如何做到这一点吗?谢谢你的时间。
$('#container').highcharts({
chart: {
type: 'columnrange',
inverted: true
},
xAxis: {
categories: ['01/01/2000', '02/01/2000', '03/01/2000', '04/01/2000', '05/01/2000', '06/01/2000', '07/01/2000']
},
yAxis: {
type: 'datetime',
title: {
text: 'Heure'
}
},
plotOptions: {
columnrange: {
dataLabels: {
enabled: true,
formatter: function () {
return (this.y.getHours()+1) + ':' + (this.y.getMinutes());
}
}
}
},
legend: {
enabled: false
},
series: [{
name: 'Working hours',
data: [
[Date(0,0,0, 12,00,00), new Date(0,0,0, 15,00,00)],
[Date(0,0,0, 13,00,00), new Date(0,0,0, 16,00,00)],
[Date(0,0,0, 14,00,00), new Date(0,0,0, 17,00,00)],
[Date(0,0,0, 13,00,00), new Date(0,0,0, 15,00,00)],
[Date(0,0,0, 13,00,00), new Date(0,0,0, 15,00,00)],
[Date(0,0,0, 13,00,00), new Date(0,0,0, 15,00,00)],
[Date(0,0,0, 13,00,00), new Date(0,0,0, 15,00,00)]
]
}]
});