简体   繁体   English

在Flot中以毫秒为单位绘制时间轴

[英]Plot the time axis with milliseconds in Flot

I am using flot library to plot the graph , i am able to plot only up to seconds using this 我正在使用flot库绘制图形,使用此图形我最多只能绘制几秒钟

xaxis: {
            mode: "time",
            timeformat: "%y/%m/%d-%H:%M:%S"
        }

I want to also plot milliseconds on x-axis . 我还想在x轴上绘制毫秒数。 Is it possible ? 可能吗 ? Any help / suggestion will be appreciated. 任何帮助/建议将不胜感激。

Currently, no, you would have to provide your own tickFormatter, like this: 当前,不,您必须提供自己的tickFormatter,如下所示:

xaxis: {
    mode: "time",
    tickFormatter: function(value, axis) {
        return value % 1000;
    }
}

We really should add a format specifier for that, though; 不过,我们确实应该为此添加一个格式说明符; perhaps %f, like Python. 可能是%f,例如Python。 You should definitely open an enhancement issue for this on Github. 您绝对应该在Github上为此打开一个增强问题

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

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