flot/flot — pull request #49 by risicle (2012-06-22 16:17:04+00:00)
Title: time plugin: add support for quarters

Hi there,

The first patch here is a more or less straightforward implementation of quarters support for time tick generation & labelling. People in the business world like quarters for some reason.

To do this I've had to add a letter for quarters in formatDate. Open Group strftime doesn't have one, so I had to make one up. "q". Hope that's ok.

At the moment it's a possibly little over-keen on using quarters, and I don't know how much "ordinary people" will appreciate that. I think it's roughly right for business users. One solution might be a configuration option to switch the use of quarters.

The second two patches implement a bit of a pet feature of mine. When I'm generating my tooltip text I introspect into the options and re-use the tickFormatter function to present a value. The first patch allows a caller to override the tickSize used and the second patch alters flot's tickFormatter wrapper function to pass thru arguments generically using arguments and apply to allow any extra arguments to be passed through to the original function unscathed.

Use what you like.