Date and time of the FLOT plot on the x axis

I use fleet cards. I want to show the date and time on the x axis. Here is my code:

$.plot($("#placeholder"), data, {
    xaxis: {
      mode: "time", 
      timeformat:"%y/%m/%d %H:%M:%S"        
    },
});

In the graph along the x axis, shown as 14/07/15 00:00:00. Time is not displayed.

+4
source share
1 answer

Answer edited after understanding the problem:

Ticks on the x axis are not where your data points are (unless you use the parameter ticks), but are evenly distributed over the range of your time values. If your data fluctuates over several days, there will be only one tick per day, and this tick will be at midnight.

To change this behavior, you can use the option tickSizewith something like

tickSize: [4, 'hour']

to create a tick every 4 hours.

.

+9

All Articles