views:

22

answers:

1

I am trying to graph with Flot some data over time. The data being graphed contains:

time: unix epoch time (whole seconds since 1/1/1970)  
value: it varies but it's always an integer between 0 and 10000

The time values can be in intervals of 5, 60 or 3600 seconds.

How do I coerce Flot into drawing me graphs where it shows the time on the x-axis:

  • in seconds if the interval is 5 seconds - there would be 10mins of data

  • in minutes if the interval is 60 seconds - there would be 1 hour of data

  • in hours if the interval is 3600 seconds - there would be 24 hours of data

I have tried working with the axis.tickSize option but I am completely stumped.

I'm using Flot 0.6 and jQuery 1.4.1.

A: 

Ok...stupid me didn't realise that time had to be in milliseconds.

This is a pretty good example of how to deal with time:

Flot Examples - Monthly mean atmospheric CO2 in PPM at Mauna Loa, Hawaii

And of course our own Stack Overflow reputation graphs.

Kev