Closure fix type Dyraph->Dygraph.
[dygraphs.git] / dygraph-options-reference.js
index cb8b767..38fefcc 100644 (file)
@@ -23,7 +23,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "default": "false",
     "labels": ["Data Line display"],
     "type": "boolean",
-    "description": "If set, stack series on top of one another rather than drawing them independently."
+    "description": "If set, stack series on top of one another rather than drawing them independently. The first series specified in the input data will wind up on top of the chart and the last will be on bottom."
   },
   "pointSize": {
     "default": "1",
@@ -35,17 +35,19 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "default": "null",
     "labels": ["Legend"],
     "type": "{}",
-    "description": "Additional styles to apply to the currently-highlighted points div. For example, { 'font-weight': 'bold' } will make the labels bold."
+    "description": "Additional styles to apply to the currently-highlighted points div. For example, { 'fontWeight': 'bold' } will make the labels bold. In general, it is better to use CSS to style the .dygraph-legend class than to use this property."
   },
   "drawPoints": {
     "default": "false",
     "labels": ["Data Line display"],
     "type": "boolean",
-    "description": "Draw a small dot at each point, in addition to a line going through \
-        the point. This makes the individual data points easier to see, but  \
-        can increase visual clutter in the chart. The small dot can be \
-        replaced with a custom rendering by supplying a \
-        <a href='#drawPointCallback'>drawPointCallback</a>."
+    "description": "Draw a small dot at each point, in addition to a line going through the point. This makes the individual data points easier to see, but can increase visual clutter in the chart. The small dot can be replaced with a custom rendering by supplying a <a href='#drawPointCallback'>drawPointCallback</a>."
+  },
+  "drawGapEdgePoints": {
+    "default": "false",
+    "labels": ["Data Line display"],
+    "type": "boolean",
+    "description": "Draw points at the edges of gaps in the data. This improves visibility of small data segments or other data irregularities."
   },
   "drawPointCallback": {
     "default": "null",
@@ -60,17 +62,13 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
       [ "color" , "series color" ],
       [ "pointSize" , "the radius of the image." ]
     ],
-    "description": "Draw a custom item when drawPoints is enabled. \
-        Default is a small dot matching the series color. This method \
-        should constrain drawing to within pointSize pixels from (cx, cy). \
-        Also see <a href='#drawHighlightPointCallback'>drawHighlightPointCallback</a>"
+    "description": "Draw a custom item when drawPoints is enabled. Default is a small dot matching the series color. This method should constrain drawing to within pointSize pixels from (cx, cy).  Also see <a href='#drawHighlightPointCallback'>drawHighlightPointCallback</a>"
   },
   "height": {
     "default": "320",
     "labels": ["Overall display"],
     "type": "integer",
-    "description": "Height, in pixels, of the chart. If the container div has \
-      been explicitly sized, this will be ignored."
+    "description": "Height, in pixels, of the chart. If the container div has been explicitly sized, this will be ignored."
   },
   "zoomCallback": {
     "default": "null",
@@ -81,8 +79,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
       [ "maxDate" , "milliseconds since epoch." ],
       [ "yRanges" , "is an array of [bottom, top] pairs, one for each y-axis." ]
     ],
-    "description": "A function to call when the zoom window is changed (either \
-      by zooming in or out)."
+    "description": "A function to call when the zoom window is changed (either by zooming in or out)."
   },
   "pointClickCallback": {
     "snippet": "function(e, point){<br>&nbsp;&nbsp;alert(point);<br>}",
@@ -134,10 +131,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
       [ "color" , "series color" ],
       [ "pointSize" , "the radius of the image." ]
     ],
-    "description": "Draw a custom item when a point is highlighted. \
-        Default is a small dot matching the series color. This method \
-        should constrain drawing to within pointSize pixels from (cx, cy) \
-        Also see <a href='#drawPointCallback'>drawPointCallback</a>"
+    "description": "Draw a custom item when a point is highlighted.  Default is a small dot matching the series color. This method should constrain drawing to within pointSize pixels from (cx, cy) Also see <a href='#drawPointCallback'>drawPointCallback</a>"
   },
   "highlightSeriesOpts": {
     "default": "null",
@@ -275,10 +269,10 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
   "underlayCallback": {
     "default": "null",
     "labels": ["Callbacks"],
-    "type": "function(canvas, area, dygraph)",
+    "type": "function(context, area, dygraph)",
     "parameters": [
-      [ "canvas" , "the canvas to draw on" ],
-      [ "area" , "" ],
+      [ "context" , "the canvas drawing context on which to draw" ],
+      [ "area" , "An object with {x,y,w,h} properties describing the drawing area." ],
       [ "dygraph" , "the reference graph" ]
     ],
     "description": "When set, this callback gets called before the chart is drawn. It details on how to use this."
@@ -376,7 +370,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "labels": ["Data Line display"],
     "type": "array<integer>",
     "example": "[10, 2, 5, 2]",
-    "description": "A custom pattern array where the even index is a draw and odd is a space in pixels. If null then it draws a solid line. The array should have a even length as any odd lengthed array could be expressed as a smaller even length array."
+    "description": "A custom pattern array where the even index is a draw and odd is a space in pixels. If null then it draws a solid line. The array should have a even length as any odd lengthed array could be expressed as a smaller even length array. This is used to create dashed lines."
   },
   "strokeBorderWidth": {
     "default": "null",
@@ -402,7 +396,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "default": "false",
     "labels": ["Data Line display"],
     "type": "boolean",
-    "description": "Should the area underneath the graph be filled? This option is not compatible with error bars."
+    "description": "Should the area underneath the graph be filled? This option is not compatible with error bars. This may be set on a <a href='per-axis.html'>per-series</a> basis."
   },
   "highlightCircleSize": {
     "default": "3",
@@ -427,7 +421,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "labels": ["Axis display"],
     "type": "Array of two numbers",
     "example": "[10, 110]",
-    "description": "Explicitly set the vertical range of the graph to [low, high]. This may be set on a per-axis basis to define each y-axis separately."
+    "description": "Explicitly set the vertical range of the graph to [low, high]. This may be set on a per-axis basis to define each y-axis separately. If either limit is unspecified, it will be calculated automatically (e.g. [null, 30] to automatically calculate just the lower bound)"
   },
   "labelsDivWidth": {
     "default": "250",
@@ -475,7 +469,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "default": "false",
     "labels": ["Data Line display"],
     "type": "boolean",
-    "description": "When set, display the graph as a step plot instead of a line plot."
+    "description": "When set, display the graph as a step plot instead of a line plot. This option may either be set for the whole graph or for single series."
   },
   "labelsKMB": {
     "default": "false",
@@ -491,9 +485,27 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
   },
   "avoidMinZero": {
     "default": "false",
+    "labels": ["Deprecated"],
+    "type": "boolean",
+    "description": "Deprecated, please use yRangePad instead. When set, the heuristic that fixes the Y axis at zero for a data set with the minimum Y value of zero is disabled. \nThis is particularly useful for data sets that contain many zero values, especially for step plots which may otherwise have lines not visible running along the bottom axis."
+  },
+  "drawAxesAtZero": {
+    "default": "false",
     "labels": ["Axis display"],
     "type": "boolean",
-    "description": "When set, the heuristic that fixes the Y axis at zero for a data set with the minimum Y value of zero is disabled. \nThis is particularly useful for data sets that contain many zero values, especially for step plots which may otherwise have lines not visible running along the bottom axis."
+    "description": "When set, draw the X axis at the Y=0 position and the Y axis at the X=0 position if those positions are inside the graph's visible area. Otherwise, draw the axes at the bottom or left graph edge as usual."
+  },
+  "xRangePad": {
+    "default": "0",
+    "labels": ["Axis display"],
+    "type": "float",
+    "description": "Add the specified amount of extra space (in pixels) around the X-axis value range to ensure points at the edges remain visible."
+  },
+  "yRangePad": {
+    "default": "null",
+    "labels": ["Axis display"],
+    "type": "float",
+    "description": "If set, add the specified amount of extra space (in pixels) around the Y-axis value range to ensure points at the edges remain visible. If unset, use the traditional Y padding algorithm."
   },
   "xAxisLabelFormatter": {
     "default": "",
@@ -728,7 +740,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "default": "false",
     "labels": ["Interactive Elements"],
     "type": "boolean",
-    "description": "Show the range selector widget. This option can only be specified at Dygraph creation time."
+    "description": "Show or hide the range selector widget."
   },
   "rangeSelectorHeight": {
     "default": "40",
@@ -753,6 +765,24 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "labels": ["Interactive Elements"],
     "type": "boolean",
     "description": "Set this option to animate the transition between zoom windows. Applies to programmatic and interactive zooms. Note that if you also set a drawCallback, it will be called several times on each zoom. If you set a zoomCallback, it will only be called after the animation is complete."
+  },
+  "plotter": {
+    "default": "[DygraphCanvasRenderer.Plotters.fillPlotter, DygraphCanvasRenderer.Plotters.errorPlotter, DygraphCanvasRenderer.Plotters.linePlotter]",
+    "labels": ["Data Line display"],
+    "type": "array or function",
+    "description": "A function (or array of functions) which plot each data series on the chart. TODO(danvk): more details! May be set per-series."
+  },
+  "series": {
+    "default": "null",
+    "labels": ["Series"],
+    "type": "Object",
+    "description": "Defines per-series options. Its keys match the y-axis label names, and the values are dictionaries themselves that contain options specific to that series. When this option is missing, it falls back on the old-style of per-series options comingled with global options."
+  },
+  "plugins": {
+    "default": "[]",
+    "labels": ["Configuration"],
+    "type": "Array<plugin>",
+    "description": "Defines per-graph plug-ins. Useful for per-graph customization"
   }
 }
 ;  // </JSON>
@@ -764,7 +794,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
 // Do a quick sanity check on the options reference.
 (function() {
   "use strict";
-  var warn = function(msg) { if (console) console.warn(msg); };
+  var warn = function(msg) { if (window.console) window.console.warn(msg); };
   var flds = ['type', 'default', 'description'];
   var valid_cats = [
    'Annotations',
@@ -781,9 +811,11 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
    'Legend',
    'Overall display',
    'Rolling Averages',
+   'Series',
    'Value display/formatting',
    'Zooming',
    'Debugging',
+   'Configuration',
    'Deprecated'
   ];
   var i;