开发者

How do I show time on the x-axis in Flot?

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 w开发者_Python百科here 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜