1

无法在浏览器中显示浮点数据

   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
4

1 回答 1

2

只需传递带有 x,y 对的数组数组。然后将在 x 参数上调用 xaxis 时间函数,该参数是时间戳。

capacityList = [[1345681620000,15]]

http://people.iola.dk/olau/flot/examples/time.html

于 2012-09-11T03:02:08.173 回答