user1260967
user1260967

Reputation: 99

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

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

I want to also plot milliseconds on x-axis . Is it possible ? Any help / suggestion will be appreciated.

Upvotes: 1

Views: 1330

Answers (1)

DNS
DNS

Reputation: 38219

Currently, no, you would have to provide your own tickFormatter, like this:

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

We really should add a format specifier for that, though; perhaps %f, like Python. You should definitely open an enhancement issue for this on Github.

Upvotes: 1

Related Questions