Merge branch 'kberg-work'
[dygraphs.git] / dygraph-options-reference.js
index 3030bc7..1a81390 100644 (file)
@@ -4,9 +4,6 @@
  * MIT-licensed (http://opensource.org/licenses/MIT)
  */
 
-/*jshint globalstrict: true */
-/*global Dygraph:false */
-
 // NOTE: in addition to parsing as JS, this snippet is expected to be valid
 // JSON. This assumption cannot be checked in JS, but it will be checked when
 // documentation is generated by the generate-documentation.py script. For the
@@ -193,24 +190,12 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "type": "boolean",
     "description": "Put <code>&lt;br/&gt;</code> between lines in the label string. Often used in conjunction with <strong>labelsDiv</strong>."
   },
-  "xValueFormatter": {
-    "default": "",
-    "labels": ["Deprecated"],
-    "type": "",
-    "description": "Prefer axes: { x: { valueFormatter } }"
-  },
   "valueFormatter": {
     "default": "Depends on the type of your data.",
     "labels": ["Legend", "Value display/formatting"],
     "type": "function(num or millis, opts, dygraph)",
     "description": "Function to provide a custom display format for the values displayed on mouseover. This does not affect the values that appear on tick marks next to the axes. To format those, see axisLabelFormatter. This is usually set on a <a href='per-axis.html'>per-axis</a> basis. For date axes, you can call new Date(millis) to get a Date object. opts is a function you can call to access various options (e.g. opts('labelsKMB'))."
   },
-  "pixelsPerYLabel": {
-    "default": "",
-    "labels": ["Deprecated"],
-    "type": "integer",
-    "description": "Prefer axes: { y: { pixelsPerLabel } }"
-  },
   "annotationMouseOverHandler": {
     "default": "null",
     "labels": ["Annotations"],
@@ -318,12 +303,6 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     ],
     "description": "This lets you specify an arbitrary function to generate tick marks on an axis. The tick marks are an array of (value, label) pairs. The built-in functions go to great lengths to choose good tick marks so, if you set this option, you'll most likely want to call one of them and modify the result. See dygraph-tickers.js for an extensive discussion. This is set on a <a href='per-axis.html'>per-axis</a> basis."
   },
-  "xAxisLabelWidth": {
-    "default": "50",
-    "labels": ["Axis display"],
-    "type": "integer",
-    "description": "Width, in pixels, of the x-axis labels."
-  },
   "xAxisHeight": {
     "default": "(null)",
     "labels": ["Axis display"],
@@ -339,17 +318,11 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
   "axis": {
     "default": "(none)",
     "labels": ["Axis display"],
-    "type": "string or object",
-    "description": "Set to either an object ({}) filled with options for this axis or to the name of an existing data series with its own axis to re-use that axis. See tests for usage."
-  },
-  "pixelsPerXLabel": {
-    "default": "",
-    "labels": ["Deprecated"],
-    "type": "integer",
-    "description": "Prefer axes { x: { pixelsPerLabel } }"
+    "type": "string",
+    "description": "Set to either 'y1' or 'y2' to assign a series to a y-axis (primary or secondary). Must be set per-series."
   },
   "pixelsPerLabel": {
-    "default": "60 (x-axis) or 30 (y-axes)",
+    "default": "70 (x-axis) or 30 (y-axes)",
     "labels": ["Axis display", "Grid"],
     "type": "integer",
     "description": "Number of pixels to require between each x- and y-label. Larger values will yield a sparser axis with fewer ticks. This is set on a <a href='per-axis.html'>per-axis</a> basis."
@@ -425,6 +398,13 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "type": "red, blue",
     "description": "The color of the gridlines. This may be set on a per-axis basis to define each axis' grid separately."
   },
+  "gridLinePattern": {
+    "default": "null",
+    "labels": ["Grid"],
+    "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. This is used to create dashed gridlines."
+  },
   "visibility": {
     "default": "[true, true, ...]",
     "labels": ["Data Line display"],
@@ -450,29 +430,17 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "type": "float (0.0 - 1.0)",
     "description": "If <strong>colors</strong> is not specified, saturation of the automatically-generated data series colors."
   },
-  "yAxisLabelWidth": {
-    "default": "50",
-    "labels": ["Axis display"],
-    "type": "integer",
-    "description": "Width, in pixels, of the y-axis labels. This also affects the amount of space available for a y-axis chart label."
-  },
   "hideOverlayOnMouseOut": {
     "default": "true",
     "labels": ["Interactive Elements", "Legend"],
     "type": "boolean",
     "description": "Whether to hide the legend when the mouse leaves the chart area."
   },
-  "yValueFormatter": {
-    "default": "",
-    "labels": ["Deprecated"],
-    "type": "",
-    "description": "Prefer axes: { y: { valueFormatter } }"
-  },
   "legend": {
     "default": "onmouseover",
     "labels": ["Legend"],
     "type": "string",
-    "description": "When to display the legend. By default, it only appears when a user mouses over the chart. Set it to \"always\" to always display a legend of some sort."
+    "description": "When to display the legend. By default, it only appears when a user mouses over the chart. Set it to \"always\" to always display a legend of some sort. When set to \"follow\", legend follows highlighted points."
   },
   "labelsShowZeroValues": {
     "default": "true",
@@ -486,6 +454,12 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "type": "boolean",
     "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."
   },
+  "labelsUTC": {
+    "default": "false",
+    "labels": ["Value display/formatting", "Axis display"],
+    "type": "boolean",
+    "description": "Show date/time labels according to UTC (instead of local time)."
+  },
   "labelsKMB": {
     "default": "false",
     "labels": ["Value display/formatting"],
@@ -522,12 +496,6 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "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": "",
-    "labels": ["Deprecated"],
-    "type": "",
-    "description": "Prefer axes { x: { axisLabelFormatter } }"
-  },
   "axisLabelFormatter": {
     "default": "Depends on the data type",
     "labels": ["Axis display"],
@@ -552,12 +520,6 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     ],
     "description": "A function to call when the canvas is clicked."
   },
-  "yAxisLabelFormatter": {
-    "default": "",
-    "labels": ["Deprecated"],
-    "type": "",
-    "description": "Prefer axes: { y: { axisLabelFormatter } }"
-  },
   "labels": {
     "default": "[\"X\", \"Y1\", \"Y2\", ...]*",
     "labels": ["Legend"],
@@ -661,18 +623,6 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "type": "boolean",
     "description" : "When this option is passed to updateOptions() along with either the <code>dateWindow</code> or <code>valueRange</code> options, the zoom flags are not changed to reflect a zoomed state. This is primarily useful for when the display area of a chart is changed programmatically and also where manual zooming is allowed and use is made of the <code>isZoomed</code> method to determine this."
   },
-  "drawXGrid": {
-    "default": "true",
-    "labels": ["Grid","Deprecated"],
-    "type": "boolean",
-    "description" : "Use the per-axis option drawGrid instead. Whether to display vertical gridlines under the chart."
-  },
-  "drawYGrid": {
-    "default": "true",
-    "labels": ["Grid","Deprecated"],
-    "type": "boolean",
-    "description" : "Use the per-axis option drawGrid instead. Whether to display horizontal gridlines under the chart."
-  },
   "drawGrid": {
     "default": "true for x and y, false for y2",
     "labels": ["Grid"],
@@ -685,18 +635,6 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "type": "boolean",
     "description" : "Only valid for y and y2, has no effect on x: This option defines whether the y axes should align their ticks or if they should be independent. Possible combinations: 1.) y=true, y2=false (default): y is the primary axis and the y2 ticks are aligned to the the ones of y. (only 1 grid) 2.) y=false, y2=true: y2 is the primary axis and the y ticks are aligned to the the ones of y2. (only 1 grid) 3.) y=true, y2=true: Both axis are independent and have their own ticks. (2 grids) 4.) y=false, y2=false: Invalid configuration causes an error."
   },
-  "drawXAxis": {
-    "default": "true",
-    "labels": ["Axis display"],
-    "type": "boolean",
-    "description" : "Deprecated. Use axes : { x : { drawAxis } }."
-  },
-  "drawYAxis": {
-    "default": "true",
-    "labels": ["Axis display"],
-    "type": "boolean",
-    "description" : "Deprecated. Use axes : { y : { drawAxis } }."
-  },
   "drawAxis": {
     "default": "true for x and y, false for y2",
     "labels": ["Axis display"],
@@ -707,7 +645,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "default": "0.3",
     "labels": ["Grid"],
     "type": "float",
-    "description" : "Thickness (in pixels) of the gridlines drawn under the chart. The vertical/horizontal gridlines can be turned off entirely by using the drawXGrid and drawYGrid options. This may be set on a per-axis basis to define each axis' grid separately."
+    "description" : "Thickness (in pixels) of the gridlines drawn under the chart. The vertical/horizontal gridlines can be turned off entirely by using the drawGrid option. This may be set on a per-axis basis to define each axis' grid separately."
   },
   "axisLineWidth": {
     "default": "0.3",
@@ -734,10 +672,10 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "description" : "Color for x- and y-axis labels. This is a CSS color string."
   },
   "axisLabelWidth": {
-    "default": "50",
+    "default": "50 (y-axis), 60 (x-axis)",
     "labels": ["Axis display", "Chart labels"],
     "type": "integer",
-    "description" : "Width (in pixels) of the containing divs for x- and y-axis labels. For the y-axis, this also controls "
+    "description" : "Width (in pixels) of the containing divs for x- and y-axis labels. For the y-axis, this also controls the width of the y-axis. Note that for the x-axis, this is independent from pixelsPerLabel, which controls the spacing between labels."
   },
   "sigFigs" : {
     "default": "null",
@@ -793,6 +731,12 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "type": "string",
     "description": "The range selector mini plot fill color. This can be of the form \"#AABBCC\" or \"rgb(255,100,200)\" or \"yellow\". You can also specify null or \"\" to turn off fill."
   },
+  "showInRangeSelector": {
+    "default": "null",
+    "labels": ["Interactive Elements"],
+    "type": "boolean",
+    "description": "Mark this series for inclusion in the range selector. The mini plot curve will be an average of all such series. If this is not specified for any series, the default behavior is to average all the series. Setting it for one series will result in that series being charted alone in the range selector."
+  },
   "animatedZooms": {
     "default": "false",
     "labels": ["Interactive Elements"],
@@ -805,11 +749,17 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "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."
   },
+  "axes": {
+    "default": "null",
+    "labels": ["Configuration"],
+    "type": "Object",
+    "description": "Defines per-axis options. Valid keys are 'x', 'y' and 'y2'. Only some options may be set on a per-axis basis. If an option may be set in this way, it will be noted on this page. See also documentation on <a href='http://dygraphs.com/per-axis.html'>per-series and per-axis options</a>."
+  },
   "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."
+    "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."
   },
   "plugins": {
     "default": "[]",