Allow millisecond date ticks #776

Open
jtbandes opened this Issue Sep 16, 2016 · 2 comments

Projects

None yet

2 participants

@jtbandes

Hi, I just started using dygraphs and it's great! 😄

I noticed that dygraph-tickers.js seems to define DATEFIELD_MS, but this value is not used in any of the TICK_PLACEMENTs. It'd be great if Granularity had some values like {FIVE,TWO,ONE}_HUNDRED_MILLISECONDLY, {FIFTY,TWENTY,TEN}_MILLISECONDLY, and {FIVE_,TWO_,}MILLISECONDLY whose placements could use the milliseconds field.

On a broader note, though, as a client of the library, I wasn't able to do this myself very easily because of how the dateTicker is structured — even though getDateAxis is exported, the granularity passed to it is used to look up a value in the non-exported TICK_PLACEMENT array (and pickDateTickGranularity is also private). This might be improved by having getDateAxis accept the {datefield, step, spacing} as arguments, rather than the granularity — then users could replicate+modify the default dateTicker more easily. Just a thought 😺

@jtbandes

(I'd be up for implementing this and submitting a PR, but you'll have to let me know which approach you prefer.)

@pierriko
Contributor

Hi, I had started working on that but din't finish yet, I just opened #777

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment