绘图图未正确显示日期/小时。 x 轴上有 unix 时间戳的值。
数据:
[[1365712202000,61.39],[1365712510000,60.89],[1365712817000,0]]
float 配置:
$.plot(plotarea , [
{
label: "Value",
data: dataLine,
color: "#FF8848",
lines: { show: true, steps: false },
points: { show: true },
grid: { hoverable: true, clickable: true },
xaxis: { mode: "time", timeformat: "%d/%H/%M" }
}
]
最佳答案
您的配置错误。 xaxis
和 grid
不是系列选项,而是绘图选项。尝试:
$.plot($('#placeholder') ,[{
label: "Value",
data: dataLine,
color: "#FF8848",
lines: { show: true, steps: false },
points: { show: true }
}],
{
grid: { hoverable: true, clickable: true },
xaxis: { mode: "time", timeformat: "%d/%H/%M" }
}
);
fiddle here .
关于javascript - Flot 未正确显示时间戳/日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15980790/