无法在浏览器中显示flot数据
var plot = $.plot($("#placeholder"),
[{ data: capacityList, label: "Capacity(MsgNumber/min)"}],
{
series:
{
lines: { show: true },
points: { show: true }
},
crosshair: { mode: "x" },
grid: { hoverable: true, clickable: true },
yaxis: {
axisLabel: "MsgNumber",
min: 0
},
xaxis: {
axisLabel: "Time",
mode: "time",
timeformat: "%H:%M",
tickSize: 1000 * 60 * 60
}
});
capacityList是一个数组,一个元素是一个具有属性DatetimeStamp & MsgNumber
:
capacityList[12]
Object
DatetimeStamp: 1345681620000
MsgNumber: 15
答案 0 :(得分:2)
只需传递一对x,y对的数组。然后将在x参数上调用xaxis时间函数,该参数是时间戳。
capacityList = [[1345681620000,15]]