Add jsdoc for setAnnotations() and an example of how to use them with native-format...
[dygraphs.git] / docs / annotations.html
index b0281f6..d69dd29 100644 (file)
 
   <p style="clear:both">Annotations are JavaScript dictionaries. The <code>series</code> and <code>x</code> fields are required: they indicate which point the annotation should be attached to. If specified, <code>shortText</code> will appear on the annotation "flag". If you don't specify <code>shortText</code>, you can specify <code>icon</code> instead to display a small picture. The <code>text</code> parameter specifies hovertext. If you highlight the annotation and leave the mouse still, it will appear.</p>
 
+  <p>If you are using <a href="http://dygraphs.com/data.html#array">native format</a>, you need to pass in a numeric value for the <code>x</code> field. For a numeric x-axis, simply pass in the x-value of the data point on which you wish to attach the annotation. For a date axis, pass in <code>Date.parse('YYYY/MM/DD')</code>. This returns milliseconds since epoch for the date.</p>
+
   <h3>Modifying Annotations</h3>
   <p>To remove or modify existing annotations, call the
   <code>annotations</code> method to get an array of annotations. Modify that