Remove old-style series specifications.
[dygraphs.git] / dygraph-options-reference.js
index c952072..999d1df 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
@@ -99,12 +96,19 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     ],
     "description": "A function to call when a data point is clicked. and the point that was clicked."
   },
+  "color": {
+    "default": "(see description)",
+    "labels": ["Data Series Colors"],
+    "type": "string",
+    "example": "red",
+    "description": "A per-series color definition. Used in conjunction with, and overrides, the colors option."
+  },
   "colors": {
     "default": "(see description)",
     "labels": ["Data Series Colors"],
     "type": "array<string>",
     "example": "['red', '#00FF00']",
-    "description": "List of colors for the data series. These can be of the form \"#AABBCC\" or \"rgb(255,100,200)\" or \"yellow\", etc. If not specified, equally-spaced points around a color wheel are used."
+    "description": "List of colors for the data series. These can be of the form \"#AABBCC\" or \"rgb(255,100,200)\" or \"yellow\", etc. If not specified, equally-spaced points around a color wheel are used. Overridden by the 'color' option."
   },
   "connectSeparatedPoints": {
     "default": "false",
@@ -312,10 +316,10 @@ 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"],
+    "default": "",
+    "labels": ["Deprecated"],
     "type": "integer",
-    "description": "Width, in pixels, of the x-axis labels."
+    "description": "Prefer axes: { x: { axisLabelWidth } }"
   },
   "xAxisHeight": {
     "default": "(null)",
@@ -332,8 +336,8 @@ 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."
+    "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."
   },
   "pixelsPerXLabel": {
     "default": "",
@@ -342,7 +346,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "description": "Prefer axes { x: { pixelsPerLabel } }"
   },
   "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."
@@ -364,7 +368,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "default": "false",
     "labels": ["Axis display"],
     "type": "boolean",
-    "description": "When set for a y-axis, the graph shows that axis in log scale. Any values less than or equal to zero are not displayed.\n\nNot compatible with showZero, and ignores connectSeparatedPoints. Also, showing log scale with valueRanges that are less than zero will result in an unviewable graph."
+    "description": "When set for the y-axis or x-axis, the graph shows that axis in log scale. Any values less than or equal to zero are not displayed. Showing log scale with ranges that go below zero will result in an unviewable graph.\n\n Not compatible with showZero. connectSeparatedPoints is ignored. This is ignored for date-based x-axes."
   },
   "strokeWidth": {
     "default": "1.0",
@@ -418,6 +422,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"],
@@ -444,10 +455,10 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "description": "If <strong>colors</strong> is not specified, saturation of the automatically-generated data series colors."
   },
   "yAxisLabelWidth": {
-    "default": "50",
-    "labels": ["Axis display"],
+    "default": "",
+    "labels": ["Deprecated"],
     "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."
+    "description": "Prefer axes { y: { axisLabelWidth } }"
   },
   "hideOverlayOnMouseOut": {
     "default": "true",
@@ -465,7 +476,7 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "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",
@@ -479,6 +490,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"],
@@ -682,13 +699,19 @@ Dygraph.OPTIONS_REFERENCE =  // <JSON>
     "default": "true",
     "labels": ["Axis display"],
     "type": "boolean",
-    "description" : "Whether to draw the x-axis. Setting this to false also prevents x-axis ticks from being drawn and reclaims the space for the chart grid/lines."
+    "description" : "Deprecated. Use axes : { x : { drawAxis } }."
   },
   "drawYAxis": {
     "default": "true",
     "labels": ["Axis display"],
     "type": "boolean",
-    "description" : "Whether to draw the y-axis. Setting this to false also prevents y-axis ticks from being drawn and reclaims the space for the chart grid/lines."
+    "description" : "Deprecated. Use axes : { y : { drawAxis } }."
+  },
+  "drawAxis": {
+    "default": "true for x and y, false for y2",
+    "labels": ["Axis display"],
+    "type": "boolean",
+    "description" : "Whether to draw the specified axis. This may be set on a per-axis basis to define the visibility of each axis separately. Setting this to false also prevents axis ticks from being drawn and reclaims the space for the chart grid/lines."
   },
   "gridLineWidth": {
     "default": "0.3",
@@ -721,10 +744,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",
@@ -780,6 +803,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"],
@@ -792,17 +821,29 @@ 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": "[]",
     "labels": ["Configuration"],
     "type": "Array<plugin>",
-    "description": "Defines per-graph plug-ins. Useful for per-graph customization"
+    "description": "Defines per-graph plugins. Useful for per-graph customization"
+  },
+  "dataHandler": {
+    "default": "(depends on data)",
+    "labels": ["Data"],
+    "type": "Dygraph.DataHandler",
+    "description": "Custom DataHandler. This is an advanced customization. See http://bit.ly/151E7Aq."
   }
 }
 ;  // </JSON>