Time series annotations need millsecs, not Date objects #782

raybellis opened this Issue Sep 30, 2016 · 4 comments


None yet

3 participants


The x value associated with an annotation in a time series needs to be the numeric value of the timestamp, not the Date object itself. Dygraphs knows how to deal with the latter for normal data sets, but not for annotations.

The cause is the string concatenation used to produce the compound key that indexes the layout module's set of annotated points.


danvk commented Sep 30, 2016

Is this a bug report or a request for an API change?


At the very least it needs a documentation change, or alternately have the layout module perform an explicit conversion to milliseconds if the passed x point is a Date object.

danvk commented Oct 1, 2016

Is there something specific you can point to in the documentation that's incorrect?


When the x-axis is "date", annotation's x value cannot be a date object. Instead timestamp (date in epoch) must be used in the annotation's x value.
Eg: below would not work

ann= {
   x: new Date()

instead use

ann = {
   x: new Date().getTime()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment