我有一个带有时间序列的jQuery 浮点图表,其中第一个 x 轴刻度未对齐(溢出图表边框)。该图表具有显示日期的自定义刻度。
var options = {
xaxis: {
mode: "time",
timeformat: "%Y-%m-%d",
ticks: [1372636800000, 1372723200000, 1372809600000]
},
yaxis: {
tickLength: 0
},
legend: {
show: false
}
};
var readings = [
{
"label": "Trend 1",
"data": [
[
1372636800000, //Mon, 01 Jul 2013 00:00:00 UTC
2.65
],
[
1372723200000, //Tue, 02 Jul 2013 00:00:00 UTC
0.13
],
[
1372809600000, //Wed, 03 Jul 2013 00:00:00 UTC
0.51
]
]
},
{
"label": "Trend 2",
"data": [
[
1372636800000, //Mon, 01 Jul 2013 00:00:00 UTC
2.19
],
[
1372723200000, //Tue, 02 Jul 2013 00:00:00 UTC
1.56
],
[
1372809600000, //Wed, 03 Jul 2013 00:00:00 UTC
1.42
],
]
}
]
$(function () {
$.plot($("#chart"), readings, options);
});
据我所知,时间戳正确表示 UTC YYYY-MM-DD 00:00:00。
导致错位的原因是什么?我该如何解决?