Back to Opencart

Flot Examples: Time Axes

upload/admin/view/javascript/jquery/flot/examples/axes-time/index.html

4.1.0.4845 B
Original Source

Monthly mean atmospheric CO2 in PPM at Mauna Loa, Hawaii (source: NOAA/ESRL).

If you tell Flot that an axis represents time, the data will be interpreted as timestamps and the ticks adjusted and formatted accordingly.

Zoom to: Whole period1990-20001996-2000

Zoom to: 1999 by quarter1999 by monthLast week of 1999Dec. 31, 1999

The timestamps must be specified as Javascript timestamps, as milliseconds since January 1, 1970 00:00. This is like Unix timestamps, but in milliseconds instead of seconds (remember to multiply with 1000!).

As an extra caveat, the timestamps are interpreted according to UTC and, by default, displayed as such. You can set the axis "timezone" option to "browser" to display the timestamps in the user's timezone, or, if you use timezoneJS, you can specify a time zone.