x2axis 日期与 x1axis 时间不一致。x2axis 标签是 MM-dd 格式的日期,这应该与 x1axis 中设置的时间一致,即一个小时。但是这个显示在 8:00,这应该是 00:00
var plot = $.plot('#divPlaceholder', [
{ label: itemKey[0], data: itemValue[0], color: '#4bb2c5' },
{ label: itemKey[1], data: itemValue[1], color: '#c5b47f' }
], {
series: {
lines: { show: true },
points: { show: true }
},
xaxis: {
mode: "time",
position: "top",
min: minVal, // this is current day - 24 hours
max: maxVal, // this is current date + 1 hours
timeformat: tickFormat,
tickSize: interval,
twelveHourClock: true,
zoomRange: [0.1, 10]
},
x2axis:{
show:true,
mode:'time',
position:'top',
timeformat:'%b-%d',
tickSize: [1, 'day'],
axisLabel: 'Lab Results',
axisLabelUseCanvas: true,
axisLabelFontSizePixels: 16,
axisLabelFontFamily: "Verdana, Arial, Helvetica, Tahoma, sans-serif",
axisLabelPadding: 0
},
yaxis: {
min: 0,
panRange:[-10, 100]
},
grid: {
hoverable: true,
clickable: true,
backgroundColor: 'gray'
},
zoom: {
interactive: false
}
});