简体   繁体   English

在xaxis中使用时间时,不显示Flot Graph

[英]Flot Graph is not showing when using time in xaxis

I'm trying to use flot to graph data and have the time for data along the x axis. 我正在尝试使用flot绘制数据图形,并花一些时间沿x轴方向显示数据。 The graph works fine until I add time mode in the options. 在我在选项中添加时间模式之前,该图工作正常。 Everything I've seen says the problem is the time stamp but I've converted it to the Javascript time stamp. 我所看到的一切都表明问题是时间戳,但是我已经将其转换为Javascript时间戳。 Here is the code I have. 这是我的代码。

    var data = [[1272701100000,2.475],[1272701400000,2.475],[1272701700000,2.475],[1272702000000,2.7],[1272702300000,2.745],[1272702600000,2.7],[1272702900000,2.565],[1272703200000,2.475],[1272703500000,2.385],[1272703800000,2.52]];
    var options = {xaxis: {
        mode: "time"
    }};
    $.plot("#placeholder",[data]);

Works fine when you include the Flot time plugin: updated fiddle 当您包括Flot time插件时,效果很好: 更新了小提琴

在此处输入图片说明

Error was in the console: 控制台出现错误:

Error: Time mode requires the flot.time plugin.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM