Javascript 如何在jqplot中给出一天中每小时的刻度间隔?
在下面的代码中,我在给定日期的某些小时具有值。我每天每小时需要24分。所以在这里,我的图表应该有两个部分,持续两天,每个部分应该有24个点,即使有些小时没有数据。现在它显示了“2013-10-15 4:00”和“2013-10-16 11:00”之间的时间间隔,即从第一天的第4小时开始,到第二天的第11小时结束。我怎样才能像这样改变我的图表?请给我一个解决方案Javascript 如何在jqplot中给出一天中每小时的刻度间隔?,javascript,jquery,jqplot,Javascript,Jquery,Jqplot,在下面的代码中,我在给定日期的某些小时具有值。我每天每小时需要24分。所以在这里,我的图表应该有两个部分,持续两天,每个部分应该有24个点,即使有些小时没有数据。现在它显示了“2013-10-15 4:00”和“2013-10-16 11:00”之间的时间间隔,即从第一天的第4小时开始,到第二天的第11小时结束。我怎样才能像这样改变我的图表?请给我一个解决方案 line1=[['2013-10-15 4:00',4], ['2013-10-15 6:00',6.5], ['2013-10-1
line1=[['2013-10-15 4:00',4], ['2013-10-15 6:00',6.5], ['2013-10-16 9:00',5.7], ['2013-10-16 11:00',9]];
var plot1 = $.jqplot('chart1', [line1], {
title:'Server Activity',
axesDefaults: {
tickRenderer: $.jqplot.CanvasAxisTickRenderer ,
tickOptions: {
fontFamily: 'Georgia',
fontSize: '10pt',
angle: -40
}
},
series:[{lineWidth:1}],
rendererOptions: {
smooth: true
},
gridPadding:{right:35},
axes:{
xaxis:{
renderer:$.jqplot.DateAxisRenderer, tickOptions:{
// formatString:'%b %d, %Y %H:00',
formatString:'%b %d, %Y %H:00',
tickOptions: {
mark: 'outside', // Where to put the tick mark on the axis
show: true, // wether to show the tick (mark and label),
showLabel: true, // w ether to show the text label at the tick,
formatString: '', // format string to use with the axis tick formatter
fontSize:11,
markSize: 10
}
} ,
tickInterval : '1 hour'
//numberTicks: 20
},
yaxis:{
min:0,
tickOptions: {
mark: 'inside', // Where to put the tick mark on the axis
show: true, // wether to show the tick (mark and label),
showLabel: true, // wether to show the text label at the tick,
formatString: '%d' , // format string to use with the axis tick formatter
fontSize:11
}
}
},
highlighter: {
show: true,
sizeAdjust: 7.5
},
cursor: {
show: false
}
//series:[{lineWidth:2}],
});