Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery flot-xaxis时间_Jquery_Flot - Fatal编程技术网

jquery flot-xaxis时间

jquery flot-xaxis时间,jquery,flot,Jquery,Flot,在本例中,xaxis将比较 $.plot($("#placeholder"), data, { yaxis: {}, xaxis: { mode: "time",minTickSize: [1, "day"],timeformat: "%d/%m/%y"},"lines": {"show": "true"},"points": {"show": "true"},clickable:true,hoverable: true

在本例中,xaxis将比较

$.plot($("#placeholder"), data, {
                yaxis: {},
                xaxis: { mode: "time",minTickSize: [1, "day"],timeformat: "%d/%m/%y"},"lines": {"show": "true"},"points": {"show": "true"},clickable:true,hoverable: true
            });
如何打印时间

这就是我想要的结果:

22:00 23:00:00 01:00 02:00。。。。。。23:00 00:00 01:00 02:00 .... 06:00

可能吗

$.plot($("#placeholder"), data, {
        yaxis: {
        },
        xaxis: { mode: "time",minTickSize: [1, "hour"],
                min: (new Date("2000/01/01")).getTime(),
                max: (new Date("2000/01/02")).getTime()
},
        "lines": {"show": "true"},
        "points": {"show": "true"},
        clickable:true,hoverable: true
});

以此为起点,您可以在这里看到Flot Api官方文档中的结果:(请参阅)

这将导致打勾标签,如“2000/12/24”。以下 支持说明符

 %h: hours
  %H: hours (left-padded with a zero)
  %M: minutes (left-padded with a zero)
  %S: seconds (left-padded with a zero)
  %d: day of month (1-31), use %0d for zero-padding
  %m: month (1-12), use %0m for zero-padding
  %y: year (2 digits)
  %Y: year (4 digits)
  %b: month name (customizable)
  %p: am/pm, additionally switches %h/%H to 12 hour instead of 24
  %P: AM/PM (uppercase version of %p)

超级挑剔,你需要在“时间”后加一个逗号。我很确定捕捉异常抛出错误不是超级挑剔。另一个超级挑剔:如果你要引用官方文档,链接到它们会很有帮助。:%)y表示一年两位数。@Margo在最新版本的flot中使用%y表示四位数,使用%y表示两位数。您的小提琴在当前的Chrome中没有显示任何线条
 %h: hours
  %H: hours (left-padded with a zero)
  %M: minutes (left-padded with a zero)
  %S: seconds (left-padded with a zero)
  %d: day of month (1-31), use %0d for zero-padding
  %m: month (1-12), use %0m for zero-padding
  %y: year (2 digits)
  %Y: year (4 digits)
  %b: month name (customizable)
  %p: am/pm, additionally switches %h/%H to 12 hour instead of 24
  %P: AM/PM (uppercase version of %p)