I have a jQuery flot chart with a time series where the first x-axis tick is misaligned (overflows outside the chart border). The chart has custom ticks showing dates.
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);
});
To my knowledge the timestamps correctly represent UTC YYYY-MM-DD 00:00:00.
What causes the misalignment? How do I fix this?