Skip to content

Allow millisecond date ticks #776

Description

@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 😺

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions