我想要繪製每個員工在使用Highcharts的條形圖中在手機上花費的時間長度。我沒有收到任何錯誤,但該圖並未繪製。任何意見前進將不勝感激。時間:分鐘:HighCharts中的秒數柱狀圖
<script type="text/javascript">
<!-- create the highcharts object -->
$(function() {
$('#container').highcharts({
chart: {
type: 'column',
backgroundColor: 'transparent'
},
title: {
text: ''
},
xAxis: {
categories: ['May 2013', 'June 2013', 'July 2013', 'August 2013', 'September 2013', 'October 2013', 'November 2013', 'December 2013', 'January 2014', 'February 2014', 'March 2014', 'April 2014', ]
},
yAxis: {
// type: 'datetime', //y-axis will be in milliseconds
dateTimeLabelFormats: { //force all formats to be hour:minute:second
second: '%H:%M:%S',
minute: '%H:%M:%S',
hour: '%H:%M:%S',
day: '%H:%M:%S',
week: '%H:%M:%S',
month: '%H:%M:%S',
year: '%H:%M:%S'
},
title: {
text: 'Time Spent on Phone'
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y} calls</b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [
{ name: 'Michelle', data: ["02:19:36", "02:37:26", "01:57:27", "02:23:49", "02:10:49", "02:32:33", "02:16:10", "01:25:01", "00:50:49", "0", "0", "0", ] },{ name: 'Kim', data: ["04:53:56", "09:21:07", "10:32:46", "10:30:21", "09:15:12", "09:15:57", "06:19:16", "08:59:23", "06:11:48", "0", "0", "0", ] },{ name: 'Katie', data: ["0", "0", "0", "0", "0", "0", "0", "08:00:14", "03:59:01", "0", "0", "0", ] }, ]
});
});
</script>
</div>
您是否包含jquery,然後是highcharts js文件? – wergeld
是的,我做到了。圖表的輪廓顯示,但沒有繪製條形圖。 – Dan
我在這裏的答案可能會對你有所幫助:http://stackoverflow.com/questions/21227847/how-to-pass-time-in-highcharts/21268457#21268457 – jlbriggs