add timingName option
[dygraphs.git] / dygraph-options-reference.js
index 8709ffa..74b7bed 100644 (file)
@@ -352,12 +352,11 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "description": "Function to call to format values along the x axis."
   },
   "clickCallback": {
-    "snippet": "function(e, date){<br>&nbsp;&nbsp;alert(date);<br>}",
+    "snippet": "function(e, date_millis){<br>&nbsp;&nbsp;alert(new Date(date_millis));<br>}",
     "default": "null",
     "labels": ["Callbacks"],
-    "type": "function(e, date, points)",
-    // NOTE(konigsberg): Is this description correct?
-    "description": "A function to call when the canvas is clicked. The function should take three arguments, the event object for the click, the date that was clicked, and the closest points along that date. The points have these properties:\n * xval/yval: The data coordinates of the point (with dates/times as millis since epoch) \n * canvasx/canvasy: The canvas coordinates at which the point is drawn. \n name: The name of the data series to which the point belongs"
+    "type": "function(e, x, points)",
+    "description": "A function to call when the canvas is clicked. The function should take three arguments, the event object for the click, the x-value that was clicked (for dates this is millis since epoch), and the closest points along that date. The points have these properties:\n * xval/yval: The data coordinates of the point (with dates/times as millis since epoch) \n * canvasx/canvasy: The canvas coordinates at which the point is drawn. \n name: The name of the data series to which the point belongs"
   },
   "yAxisLabelFormatter": {
     "default": "yValueFormatter",
@@ -546,6 +545,12 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "labels": ["Data"],
     "type": "string (URL of CSV or CSV), GViz DataTable or 2D Array",
     "description": "Sets the data being displayed in the chart. This can only be set when calling updateOptions; it cannot be set from the constructor. For a full description of valid data formats, see the <a href='http://dygraphs.com/data.html'>Data Formats</a> page."
+  },
+  "timingName": {
+    "default": "null",
+    "labels": [ "Debugging" ],
+    "type": "string",
+    "description": "Set this option to log timing information. The value of the option will be logged along with the timimg, so that you can distinguish multiple dygraphs on the same page."
   }
 }
 ;  // </JSON>
@@ -574,7 +579,8 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
    'Overall display',
    'Rolling Averages',
    'Value display/formatting',
-   'Zooming'
+   'Zooming',
+   'Debugging'
   ];
   var cats = {};
   for (var i = 0; i < valid_cats.length; i++) cats[valid_cats[i]] = true;