| 1 | /** |
| 2 | * @license |
| 3 | * Copyright 2011 Dan Vanderkam (danvdk@gmail.com) |
| 4 | * MIT-licensed (http://opensource.org/licenses/MIT) |
| 5 | */ |
| 6 | |
| 7 | /*jshint globalstrict: true */ |
| 8 | /*global Dygraph:false */ |
| 9 | |
| 10 | // NOTE: in addition to parsing as JS, this snippet is expected to be valid |
| 11 | // JSON. This assumption cannot be checked in JS, but it will be checked when |
| 12 | // documentation is generated by the generate-documentation.py script. For the |
| 13 | // most part, this just means that you should always use double quotes. |
| 14 | Dygraph.OPTIONS_REFERENCE = // <JSON> |
| 15 | { |
| 16 | "xValueParser": { |
| 17 | "default": "parseFloat() or Date.parse()*", |
| 18 | "labels": ["CSV parsing"], |
| 19 | "type": "function(str) -> number", |
| 20 | "description": "A function which parses x-values (i.e. the dependent series). Must return a number, even when the values are dates. In this case, millis since epoch are used. This is used primarily for parsing CSV data. *=Dygraphs is slightly more accepting in the dates which it will parse. See code for details." |
| 21 | }, |
| 22 | "stackedGraph": { |
| 23 | "default": "false", |
| 24 | "labels": ["Data Line display"], |
| 25 | "type": "boolean", |
| 26 | "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. NaN values are drawn as white areas without a line on top, see stackedGraphNaNFill for details." |
| 27 | }, |
| 28 | "stackedGraphNaNFill": { |
| 29 | "default": "all", |
| 30 | "labels": ["Data Line display"], |
| 31 | "type": "string", |
| 32 | "description": "Controls handling of NaN values inside a stacked graph. NaN values are interpolated/extended for stacking purposes, but the actual point value remains NaN in the legend display. Valid option values are \"all\" (interpolate internally, repeat leftmost and rightmost value as needed), \"inside\" (interpolate internally only, use zero outside leftmost and rightmost value), and \"none\" (treat NaN as zero everywhere)." |
| 33 | }, |
| 34 | "pointSize": { |
| 35 | "default": "1", |
| 36 | "labels": ["Data Line display"], |
| 37 | "type": "integer", |
| 38 | "description": "The size of the dot to draw on each point in pixels (see drawPoints). A dot is always drawn when a point is \"isolated\", i.e. there is a missing point on either side of it. This also controls the size of those dots." |
| 39 | }, |
| 40 | "labelsDivStyles": { |
| 41 | "default": "null", |
| 42 | "labels": ["Legend"], |
| 43 | "type": "{}", |
| 44 | "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." |
| 45 | }, |
| 46 | "drawPoints": { |
| 47 | "default": "false", |
| 48 | "labels": ["Data Line display"], |
| 49 | "type": "boolean", |
| 50 | "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>." |
| 51 | }, |
| 52 | "drawGapEdgePoints": { |
| 53 | "default": "false", |
| 54 | "labels": ["Data Line display"], |
| 55 | "type": "boolean", |
| 56 | "description": "Draw points at the edges of gaps in the data. This improves visibility of small data segments or other data irregularities." |
| 57 | }, |
| 58 | "drawPointCallback": { |
| 59 | "default": "null", |
| 60 | "labels": ["Data Line display"], |
| 61 | "type": "function(g, seriesName, canvasContext, cx, cy, color, pointSize)", |
| 62 | "parameters": [ |
| 63 | [ "g" , "the reference graph" ], |
| 64 | [ "seriesName" , "the name of the series" ], |
| 65 | [ "canvasContext" , "the canvas to draw on" ], |
| 66 | [ "cx" , "center x coordinate" ], |
| 67 | [ "cy" , "center y coordinate" ], |
| 68 | [ "color" , "series color" ], |
| 69 | [ "pointSize" , "the radius of the image." ], |
| 70 | [ "idx" , "the row-index of the point in the data."] |
| 71 | ], |
| 72 | "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>" |
| 73 | }, |
| 74 | "height": { |
| 75 | "default": "320", |
| 76 | "labels": ["Overall display"], |
| 77 | "type": "integer", |
| 78 | "description": "Height, in pixels, of the chart. If the container div has been explicitly sized, this will be ignored." |
| 79 | }, |
| 80 | "zoomCallback": { |
| 81 | "default": "null", |
| 82 | "labels": ["Callbacks"], |
| 83 | "type": "function(minDate, maxDate, yRanges)", |
| 84 | "parameters": [ |
| 85 | [ "minDate" , "milliseconds since epoch" ], |
| 86 | [ "maxDate" , "milliseconds since epoch." ], |
| 87 | [ "yRanges" , "is an array of [bottom, top] pairs, one for each y-axis." ] |
| 88 | ], |
| 89 | "description": "A function to call when the zoom window is changed (either by zooming in or out)." |
| 90 | }, |
| 91 | "pointClickCallback": { |
| 92 | "snippet": "function(e, point){<br> alert(point);<br>}", |
| 93 | "default": "null", |
| 94 | "labels": ["Callbacks", "Interactive Elements"], |
| 95 | "type": "function(e, point)", |
| 96 | "parameters": [ |
| 97 | [ "e" , "the event object for the click" ], |
| 98 | [ "point" , "the point that was clicked See <a href='#point_properties'>Point properties</a> for details" ] |
| 99 | ], |
| 100 | "description": "A function to call when a data point is clicked. and the point that was clicked." |
| 101 | }, |
| 102 | "color": { |
| 103 | "default": "(see description)", |
| 104 | "labels": ["Data Series Colors"], |
| 105 | "type": "string", |
| 106 | "example": "red", |
| 107 | "description": "A per-series color definition. Used in conjunction with, and overrides, the colors option." |
| 108 | }, |
| 109 | "colors": { |
| 110 | "default": "(see description)", |
| 111 | "labels": ["Data Series Colors"], |
| 112 | "type": "array<string>", |
| 113 | "example": "['red', '#00FF00']", |
| 114 | "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." |
| 115 | }, |
| 116 | "connectSeparatedPoints": { |
| 117 | "default": "false", |
| 118 | "labels": ["Data Line display"], |
| 119 | "type": "boolean", |
| 120 | "description": "Usually, when Dygraphs encounters a missing value in a data series, it interprets this as a gap and draws it as such. If, instead, the missing values represents an x-value for which only a different series has data, then you'll want to connect the dots by setting this to true. To explicitly include a gap with this option set, use a value of NaN." |
| 121 | }, |
| 122 | "highlightCallback": { |
| 123 | "default": "null", |
| 124 | "labels": ["Callbacks"], |
| 125 | "type": "function(event, x, points, row, seriesName)", |
| 126 | "description": "When set, this callback gets called every time a new point is highlighted.", |
| 127 | "parameters": [ |
| 128 | ["event", "the JavaScript mousemove event"], |
| 129 | ["x", "the x-coordinate of the highlighted points"], |
| 130 | ["points", "an array of highlighted points: <code>[ {name: 'series', yval: y-value}, … ]</code>"], |
| 131 | ["row", "integer index of the highlighted row in the data table, starting from 0"], |
| 132 | ["seriesName", "name of the highlighted series, only present if highlightSeriesOpts is set."] |
| 133 | ] |
| 134 | }, |
| 135 | "drawHighlightPointCallback": { |
| 136 | "default": "null", |
| 137 | "labels": ["Data Line display"], |
| 138 | "type": "function(g, seriesName, canvasContext, cx, cy, color, pointSize)", |
| 139 | "parameters": [ |
| 140 | [ "g" , "the reference graph" ], |
| 141 | [ "seriesName" , "the name of the series" ], |
| 142 | [ "canvasContext" , "the canvas to draw on" ], |
| 143 | [ "cx" , "center x coordinate" ], |
| 144 | [ "cy" , "center y coordinate" ], |
| 145 | [ "color" , "series color" ], |
| 146 | [ "pointSize" , "the radius of the image." ], |
| 147 | [ "idx" , "the row-index of the point in the data."] |
| 148 | ], |
| 149 | "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>" |
| 150 | }, |
| 151 | "highlightSeriesOpts": { |
| 152 | "default": "null", |
| 153 | "labels": ["Interactive Elements"], |
| 154 | "type": "Object", |
| 155 | "description": "When set, the options from this object are applied to the timeseries closest to the mouse pointer for interactive highlighting. See also 'highlightCallback'. Example: highlightSeriesOpts: { strokeWidth: 3 }." |
| 156 | }, |
| 157 | "highlightSeriesBackgroundAlpha": { |
| 158 | "default": "0.5", |
| 159 | "labels": ["Interactive Elements"], |
| 160 | "type": "float", |
| 161 | "description": "Fade the background while highlighting series. 1=fully visible background (disable fading), 0=hiddden background (show highlighted series only)." |
| 162 | }, |
| 163 | "includeZero": { |
| 164 | "default": "false", |
| 165 | "labels": ["Axis display"], |
| 166 | "type": "boolean", |
| 167 | "description": "Usually, dygraphs will use the range of the data plus some padding to set the range of the y-axis. If this option is set, the y-axis will always include zero, typically as the lowest value. This can be used to avoid exaggerating the variance in the data" |
| 168 | }, |
| 169 | "rollPeriod": { |
| 170 | "default": "1", |
| 171 | "labels": ["Error Bars", "Rolling Averages"], |
| 172 | "type": "integer >= 1", |
| 173 | "description": "Number of days over which to average data. Discussed extensively above." |
| 174 | }, |
| 175 | "unhighlightCallback": { |
| 176 | "default": "null", |
| 177 | "labels": ["Callbacks"], |
| 178 | "type": "function(event)", |
| 179 | "parameters": [ |
| 180 | [ "event" , "the mouse event" ] |
| 181 | ], |
| 182 | "description": "When set, this callback gets called every time the user stops highlighting any point by mousing out of the graph." |
| 183 | }, |
| 184 | "axisTickSize": { |
| 185 | "default": "3.0", |
| 186 | "labels": ["Axis display"], |
| 187 | "type": "number", |
| 188 | "description": "The size of the line to display next to each tick mark on x- or y-axes." |
| 189 | }, |
| 190 | "labelsSeparateLines": { |
| 191 | "default": "false", |
| 192 | "labels": ["Legend"], |
| 193 | "type": "boolean", |
| 194 | "description": "Put <code><br/></code> between lines in the label string. Often used in conjunction with <strong>labelsDiv</strong>." |
| 195 | }, |
| 196 | "xValueFormatter": { |
| 197 | "default": "", |
| 198 | "labels": ["Deprecated"], |
| 199 | "type": "", |
| 200 | "description": "Prefer axes: { x: { valueFormatter } }" |
| 201 | }, |
| 202 | "valueFormatter": { |
| 203 | "default": "Depends on the type of your data.", |
| 204 | "labels": ["Legend", "Value display/formatting"], |
| 205 | "type": "function(num or millis, opts, dygraph)", |
| 206 | "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'))." |
| 207 | }, |
| 208 | "pixelsPerYLabel": { |
| 209 | "default": "", |
| 210 | "labels": ["Deprecated"], |
| 211 | "type": "integer", |
| 212 | "description": "Prefer axes: { y: { pixelsPerLabel } }" |
| 213 | }, |
| 214 | "annotationMouseOverHandler": { |
| 215 | "default": "null", |
| 216 | "labels": ["Annotations"], |
| 217 | "type": "function(annotation, point, dygraph, event)", |
| 218 | "description": "If provided, this function is called whenever the user mouses over an annotation." |
| 219 | }, |
| 220 | "annotationMouseOutHandler": { |
| 221 | "default": "null", |
| 222 | "labels": ["Annotations"], |
| 223 | "type": "function(annotation, point, dygraph, event)", |
| 224 | "parameters": [ |
| 225 | [ "annotation" , "the annotation left" ], |
| 226 | [ "point" , "the point associated with the annotation" ], |
| 227 | [ "dygraph" , "the reference graph" ], |
| 228 | [ "event" , "the mouse event" ] |
| 229 | ], |
| 230 | "description": "If provided, this function is called whenever the user mouses out of an annotation." |
| 231 | }, |
| 232 | "annotationClickHandler": { |
| 233 | "default": "null", |
| 234 | "labels": ["Annotations"], |
| 235 | "type": "function(annotation, point, dygraph, event)", |
| 236 | "parameters": [ |
| 237 | [ "annotation" , "the annotation left" ], |
| 238 | [ "point" , "the point associated with the annotation" ], |
| 239 | [ "dygraph" , "the reference graph" ], |
| 240 | [ "event" , "the mouse event" ] |
| 241 | ], |
| 242 | "description": "If provided, this function is called whenever the user clicks on an annotation." |
| 243 | }, |
| 244 | "annotationDblClickHandler": { |
| 245 | "default": "null", |
| 246 | "labels": ["Annotations"], |
| 247 | "type": "function(annotation, point, dygraph, event)", |
| 248 | "parameters": [ |
| 249 | [ "annotation" , "the annotation left" ], |
| 250 | [ "point" , "the point associated with the annotation" ], |
| 251 | [ "dygraph" , "the reference graph" ], |
| 252 | [ "event" , "the mouse event" ] |
| 253 | ], |
| 254 | "description": "If provided, this function is called whenever the user double-clicks on an annotation." |
| 255 | }, |
| 256 | "drawCallback": { |
| 257 | "default": "null", |
| 258 | "labels": ["Callbacks"], |
| 259 | "type": "function(dygraph, is_initial)", |
| 260 | "parameters": [ |
| 261 | [ "dygraph" , "The graph being drawn" ], |
| 262 | [ "is_initial" , "True if this is the initial draw, false for subsequent draws." ] |
| 263 | ], |
| 264 | "description": "When set, this callback gets called every time the dygraph is drawn. This includes the initial draw, after zooming and repeatedly while panning." |
| 265 | }, |
| 266 | "labelsKMG2": { |
| 267 | "default": "false", |
| 268 | "labels": ["Value display/formatting"], |
| 269 | "type": "boolean", |
| 270 | "description": "Show k/M/G for kilo/Mega/Giga on y-axis. This is different than <code>labelsKMB</code> in that it uses base 2, not 10." |
| 271 | }, |
| 272 | "delimiter": { |
| 273 | "default": ",", |
| 274 | "labels": ["CSV parsing"], |
| 275 | "type": "string", |
| 276 | "description": "The delimiter to look for when separating fields of a CSV file. Setting this to a tab is not usually necessary, since tab-delimited data is auto-detected." |
| 277 | }, |
| 278 | "axisLabelFontSize": { |
| 279 | "default": "14", |
| 280 | "labels": ["Axis display"], |
| 281 | "type": "integer", |
| 282 | "description": "Size of the font (in pixels) to use in the axis labels, both x- and y-axis." |
| 283 | }, |
| 284 | "underlayCallback": { |
| 285 | "default": "null", |
| 286 | "labels": ["Callbacks"], |
| 287 | "type": "function(context, area, dygraph)", |
| 288 | "parameters": [ |
| 289 | [ "context" , "the canvas drawing context on which to draw" ], |
| 290 | [ "area" , "An object with {x,y,w,h} properties describing the drawing area." ], |
| 291 | [ "dygraph" , "the reference graph" ] |
| 292 | ], |
| 293 | "description": "When set, this callback gets called before the chart is drawn. It details on how to use this." |
| 294 | }, |
| 295 | "width": { |
| 296 | "default": "480", |
| 297 | "labels": ["Overall display"], |
| 298 | "type": "integer", |
| 299 | "description": "Width, in pixels, of the chart. If the container div has been explicitly sized, this will be ignored." |
| 300 | }, |
| 301 | "interactionModel": { |
| 302 | "default": "...", |
| 303 | "labels": ["Interactive Elements"], |
| 304 | "type": "Object", |
| 305 | "description": "TODO(konigsberg): document this" |
| 306 | }, |
| 307 | "ticker": { |
| 308 | "default": "Dygraph.dateTicker or Dygraph.numericTicks", |
| 309 | "labels": ["Axis display"], |
| 310 | "type": "function(min, max, pixels, opts, dygraph, vals) -> [{v: ..., label: ...}, ...]", |
| 311 | "parameters": [ |
| 312 | [ "min" , "" ], |
| 313 | [ "max" , "" ], |
| 314 | [ "pixels" , "" ], |
| 315 | [ "opts" , "" ], |
| 316 | [ "dygraph" , "the reference graph" ], |
| 317 | [ "vals" , "" ] |
| 318 | ], |
| 319 | "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." |
| 320 | }, |
| 321 | "xAxisLabelWidth": { |
| 322 | "default": "50", |
| 323 | "labels": ["Axis display"], |
| 324 | "type": "integer", |
| 325 | "description": "Width, in pixels, of the x-axis labels." |
| 326 | }, |
| 327 | "xAxisHeight": { |
| 328 | "default": "(null)", |
| 329 | "labels": ["Axis display"], |
| 330 | "type": "integer", |
| 331 | "description": "Height, in pixels, of the x-axis. If not set explicitly, this is computed based on axisLabelFontSize and axisTickSize." |
| 332 | }, |
| 333 | "showLabelsOnHighlight": { |
| 334 | "default": "true", |
| 335 | "labels": ["Interactive Elements", "Legend"], |
| 336 | "type": "boolean", |
| 337 | "description": "Whether to show the legend upon mouseover." |
| 338 | }, |
| 339 | "axis": { |
| 340 | "default": "(none)", |
| 341 | "labels": ["Axis display"], |
| 342 | "type": "string or object", |
| 343 | "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." |
| 344 | }, |
| 345 | "pixelsPerXLabel": { |
| 346 | "default": "", |
| 347 | "labels": ["Deprecated"], |
| 348 | "type": "integer", |
| 349 | "description": "Prefer axes { x: { pixelsPerLabel } }" |
| 350 | }, |
| 351 | "pixelsPerLabel": { |
| 352 | "default": "60 (x-axis) or 30 (y-axes)", |
| 353 | "labels": ["Axis display", "Grid"], |
| 354 | "type": "integer", |
| 355 | "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." |
| 356 | }, |
| 357 | "labelsDiv": { |
| 358 | "default": "null", |
| 359 | "labels": ["Legend"], |
| 360 | "type": "DOM element or string", |
| 361 | "example": "<code style='font-size: small'>document.getElementById('foo')</code>or<code>'foo'", |
| 362 | "description": "Show data labels in an external div, rather than on the graph. This value can either be a div element or a div id." |
| 363 | }, |
| 364 | "fractions": { |
| 365 | "default": "false", |
| 366 | "labels": ["CSV parsing", "Error Bars"], |
| 367 | "type": "boolean", |
| 368 | "description": "When set, attempt to parse each cell in the CSV file as \"a/b\", where a and b are integers. The ratio will be plotted. This allows computation of Wilson confidence intervals (see below)." |
| 369 | }, |
| 370 | "logscale": { |
| 371 | "default": "false", |
| 372 | "labels": ["Axis display"], |
| 373 | "type": "boolean", |
| 374 | "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." |
| 375 | }, |
| 376 | "strokeWidth": { |
| 377 | "default": "1.0", |
| 378 | "labels": ["Data Line display"], |
| 379 | "type": "float", |
| 380 | "example": "0.5, 2.0", |
| 381 | "description": "The width of the lines connecting data points. This can be used to increase the contrast or some graphs." |
| 382 | }, |
| 383 | "strokePattern": { |
| 384 | "default": "null", |
| 385 | "labels": ["Data Line display"], |
| 386 | "type": "array<integer>", |
| 387 | "example": "[10, 2, 5, 2]", |
| 388 | "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." |
| 389 | }, |
| 390 | "strokeBorderWidth": { |
| 391 | "default": "null", |
| 392 | "labels": ["Data Line display"], |
| 393 | "type": "float", |
| 394 | "example": "1.0", |
| 395 | "description": "Draw a border around graph lines to make crossing lines more easily distinguishable. Useful for graphs with many lines." |
| 396 | }, |
| 397 | "strokeBorderColor": { |
| 398 | "default": "white", |
| 399 | "labels": ["Data Line display"], |
| 400 | "type": "string", |
| 401 | "example": "red, #ccffdd", |
| 402 | "description": "Color for the line border used if strokeBorderWidth is set." |
| 403 | }, |
| 404 | "wilsonInterval": { |
| 405 | "default": "true", |
| 406 | "labels": ["Error Bars"], |
| 407 | "type": "boolean", |
| 408 | "description": "Use in conjunction with the \"fractions\" option. Instead of plotting +/- N standard deviations, dygraphs will compute a Wilson confidence interval and plot that. This has more reasonable behavior for ratios close to 0 or 1." |
| 409 | }, |
| 410 | "fillGraph": { |
| 411 | "default": "false", |
| 412 | "labels": ["Data Line display"], |
| 413 | "type": "boolean", |
| 414 | "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." |
| 415 | }, |
| 416 | "highlightCircleSize": { |
| 417 | "default": "3", |
| 418 | "labels": ["Interactive Elements"], |
| 419 | "type": "integer", |
| 420 | "description": "The size in pixels of the dot drawn over highlighted points." |
| 421 | }, |
| 422 | "gridLineColor": { |
| 423 | "default": "rgb(128,128,128)", |
| 424 | "labels": ["Grid"], |
| 425 | "type": "red, blue", |
| 426 | "description": "The color of the gridlines. This may be set on a per-axis basis to define each axis' grid separately." |
| 427 | }, |
| 428 | "visibility": { |
| 429 | "default": "[true, true, ...]", |
| 430 | "labels": ["Data Line display"], |
| 431 | "type": "Array of booleans", |
| 432 | "description": "Which series should initially be visible? Once the Dygraph has been constructed, you can access and modify the visibility of each series using the <code>visibility</code> and <code>setVisibility</code> methods." |
| 433 | }, |
| 434 | "valueRange": { |
| 435 | "default": "Full range of the input is shown", |
| 436 | "labels": ["Axis display"], |
| 437 | "type": "Array of two numbers", |
| 438 | "example": "[10, 110]", |
| 439 | "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)" |
| 440 | }, |
| 441 | "labelsDivWidth": { |
| 442 | "default": "250", |
| 443 | "labels": ["Legend"], |
| 444 | "type": "integer", |
| 445 | "description": "Width (in pixels) of the div which shows information on the currently-highlighted points." |
| 446 | }, |
| 447 | "colorSaturation": { |
| 448 | "default": "1.0", |
| 449 | "labels": ["Data Series Colors"], |
| 450 | "type": "float (0.0 - 1.0)", |
| 451 | "description": "If <strong>colors</strong> is not specified, saturation of the automatically-generated data series colors." |
| 452 | }, |
| 453 | "yAxisLabelWidth": { |
| 454 | "default": "50", |
| 455 | "labels": ["Axis display"], |
| 456 | "type": "integer", |
| 457 | "description": "Width, in pixels, of the y-axis labels. This also affects the amount of space available for a y-axis chart label." |
| 458 | }, |
| 459 | "hideOverlayOnMouseOut": { |
| 460 | "default": "true", |
| 461 | "labels": ["Interactive Elements", "Legend"], |
| 462 | "type": "boolean", |
| 463 | "description": "Whether to hide the legend when the mouse leaves the chart area." |
| 464 | }, |
| 465 | "yValueFormatter": { |
| 466 | "default": "", |
| 467 | "labels": ["Deprecated"], |
| 468 | "type": "", |
| 469 | "description": "Prefer axes: { y: { valueFormatter } }" |
| 470 | }, |
| 471 | "legend": { |
| 472 | "default": "onmouseover", |
| 473 | "labels": ["Legend"], |
| 474 | "type": "string", |
| 475 | "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." |
| 476 | }, |
| 477 | "labelsShowZeroValues": { |
| 478 | "default": "true", |
| 479 | "labels": ["Legend"], |
| 480 | "type": "boolean", |
| 481 | "description": "Show zero value labels in the labelsDiv." |
| 482 | }, |
| 483 | "stepPlot": { |
| 484 | "default": "false", |
| 485 | "labels": ["Data Line display"], |
| 486 | "type": "boolean", |
| 487 | "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." |
| 488 | }, |
| 489 | "labelsDateUTC": { |
| 490 | "default": "false", |
| 491 | "labels": ["Value display/formatting"], |
| 492 | "type": "boolean", |
| 493 | "description": "Show date/time labels according to UTC (instead of local time)." |
| 494 | }, |
| 495 | "labelsKMB": { |
| 496 | "default": "false", |
| 497 | "labels": ["Value display/formatting"], |
| 498 | "type": "boolean", |
| 499 | "description": "Show K/M/B for thousands/millions/billions on y-axis." |
| 500 | }, |
| 501 | "rightGap": { |
| 502 | "default": "5", |
| 503 | "labels": ["Overall display"], |
| 504 | "type": "integer", |
| 505 | "description": "Number of pixels to leave blank at the right edge of the Dygraph. This makes it easier to highlight the right-most data point." |
| 506 | }, |
| 507 | "avoidMinZero": { |
| 508 | "default": "false", |
| 509 | "labels": ["Deprecated"], |
| 510 | "type": "boolean", |
| 511 | "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." |
| 512 | }, |
| 513 | "drawAxesAtZero": { |
| 514 | "default": "false", |
| 515 | "labels": ["Axis display"], |
| 516 | "type": "boolean", |
| 517 | "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." |
| 518 | }, |
| 519 | "xRangePad": { |
| 520 | "default": "0", |
| 521 | "labels": ["Axis display"], |
| 522 | "type": "float", |
| 523 | "description": "Add the specified amount of extra space (in pixels) around the X-axis value range to ensure points at the edges remain visible." |
| 524 | }, |
| 525 | "yRangePad": { |
| 526 | "default": "null", |
| 527 | "labels": ["Axis display"], |
| 528 | "type": "float", |
| 529 | "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." |
| 530 | }, |
| 531 | "xAxisLabelFormatter": { |
| 532 | "default": "", |
| 533 | "labels": ["Deprecated"], |
| 534 | "type": "", |
| 535 | "description": "Prefer axes { x: { axisLabelFormatter } }" |
| 536 | }, |
| 537 | "axisLabelFormatter": { |
| 538 | "default": "Depends on the data type", |
| 539 | "labels": ["Axis display"], |
| 540 | "type": "function(number or Date, granularity, opts, dygraph)", |
| 541 | "parameters": [ |
| 542 | [ "number or date" , "Either a number (for a numeric axis) or a Date object (for a date axis)" ], |
| 543 | [ "granularity" , "specifies how fine-grained the axis is. For date axes, this is a reference to the time granularity enumeration, defined in dygraph-tickers.js, e.g. Dygraph.WEEKLY." ], |
| 544 | [ "opts" , "a function which provides access to various options on the dygraph, e.g. opts('labelsKMB')." ], |
| 545 | [ "dygraph" , "the referenced graph" ] |
| 546 | ], |
| 547 | "description": "Function to call to format the tick values that appear along an axis. This is usually set on a <a href='per-axis.html'>per-axis</a> basis." |
| 548 | }, |
| 549 | "clickCallback": { |
| 550 | "snippet": "function(e, date_millis){<br> alert(new Date(date_millis));<br>}", |
| 551 | "default": "null", |
| 552 | "labels": ["Callbacks"], |
| 553 | "type": "function(e, x, points)", |
| 554 | "parameters": [ |
| 555 | [ "e" , "The event object for the click" ], |
| 556 | [ "x" , "The x value that was clicked (for dates, this is milliseconds since epoch)" ], |
| 557 | [ "points" , "The closest points along that date. See <a href='#point_properties'>Point properties</a> for details." ] |
| 558 | ], |
| 559 | "description": "A function to call when the canvas is clicked." |
| 560 | }, |
| 561 | "yAxisLabelFormatter": { |
| 562 | "default": "", |
| 563 | "labels": ["Deprecated"], |
| 564 | "type": "", |
| 565 | "description": "Prefer axes: { y: { axisLabelFormatter } }" |
| 566 | }, |
| 567 | "labels": { |
| 568 | "default": "[\"X\", \"Y1\", \"Y2\", ...]*", |
| 569 | "labels": ["Legend"], |
| 570 | "type": "array<string>", |
| 571 | "description": "A name for each data series, including the independent (X) series. For CSV files and DataTable objections, this is determined by context. For raw data, this must be specified. If it is not, default values are supplied and a warning is logged." |
| 572 | }, |
| 573 | "dateWindow": { |
| 574 | "default": "Full range of the input is shown", |
| 575 | "labels": ["Axis display"], |
| 576 | "type": "Array of two numbers", |
| 577 | "example": "[<br> Date.parse('2006-01-01'),<br> (new Date()).valueOf()<br>]", |
| 578 | "description": "Initially zoom in on a section of the graph. Is of the form [earliest, latest], where earliest/latest are milliseconds since epoch. If the data for the x-axis is numeric, the values in dateWindow must also be numbers." |
| 579 | }, |
| 580 | "showRoller": { |
| 581 | "default": "false", |
| 582 | "labels": ["Interactive Elements", "Rolling Averages"], |
| 583 | "type": "boolean", |
| 584 | "description": "If the rolling average period text box should be shown." |
| 585 | }, |
| 586 | "sigma": { |
| 587 | "default": "2.0", |
| 588 | "labels": ["Error Bars"], |
| 589 | "type": "float", |
| 590 | "description": "When errorBars is set, shade this many standard deviations above/below each point." |
| 591 | }, |
| 592 | "customBars": { |
| 593 | "default": "false", |
| 594 | "labels": ["CSV parsing", "Error Bars"], |
| 595 | "type": "boolean", |
| 596 | "description": "When set, parse each CSV cell as \"low;middle;high\". Error bars will be drawn for each point between low and high, with the series itself going through middle." |
| 597 | }, |
| 598 | "colorValue": { |
| 599 | "default": "1.0", |
| 600 | "labels": ["Data Series Colors"], |
| 601 | "type": "float (0.0 - 1.0)", |
| 602 | "description": "If colors is not specified, value of the data series colors, as in hue/saturation/value. (0.0-1.0, default 0.5)" |
| 603 | }, |
| 604 | "errorBars": { |
| 605 | "default": "false", |
| 606 | "labels": ["CSV parsing", "Error Bars"], |
| 607 | "type": "boolean", |
| 608 | "description": "Does the data contain standard deviations? Setting this to true alters the input format (see above)." |
| 609 | }, |
| 610 | "displayAnnotations": { |
| 611 | "default": "false", |
| 612 | "labels": ["Annotations"], |
| 613 | "type": "boolean", |
| 614 | "description": "Only applies when Dygraphs is used as a GViz chart. Causes string columns following a data series to be interpreted as annotations on points in that series. This is the same format used by Google's AnnotatedTimeLine chart." |
| 615 | }, |
| 616 | "panEdgeFraction": { |
| 617 | "default": "null", |
| 618 | "labels": ["Axis display", "Interactive Elements"], |
| 619 | "type": "float", |
| 620 | "description": "A value representing the farthest a graph may be panned, in percent of the display. For example, a value of 0.1 means that the graph can only be panned 10% pased the edges of the displayed values. null means no bounds." |
| 621 | }, |
| 622 | "title": { |
| 623 | "labels": ["Chart labels"], |
| 624 | "type": "string", |
| 625 | "default": "null", |
| 626 | "description": "Text to display above the chart. You can supply any HTML for this value, not just text. If you wish to style it using CSS, use the 'dygraph-label' or 'dygraph-title' classes." |
| 627 | }, |
| 628 | "titleHeight": { |
| 629 | "default": "18", |
| 630 | "labels": ["Chart labels"], |
| 631 | "type": "integer", |
| 632 | "description": "Height of the chart title, in pixels. This also controls the default font size of the title. If you style the title on your own, this controls how much space is set aside above the chart for the title's div." |
| 633 | }, |
| 634 | "xlabel": { |
| 635 | "labels": ["Chart labels"], |
| 636 | "type": "string", |
| 637 | "default": "null", |
| 638 | "description": "Text to display below the chart's x-axis. You can supply any HTML for this value, not just text. If you wish to style it using CSS, use the 'dygraph-label' or 'dygraph-xlabel' classes." |
| 639 | }, |
| 640 | "xLabelHeight": { |
| 641 | "labels": ["Chart labels"], |
| 642 | "type": "integer", |
| 643 | "default": "18", |
| 644 | "description": "Height of the x-axis label, in pixels. This also controls the default font size of the x-axis label. If you style the label on your own, this controls how much space is set aside below the chart for the x-axis label's div." |
| 645 | }, |
| 646 | "ylabel": { |
| 647 | "labels": ["Chart labels"], |
| 648 | "type": "string", |
| 649 | "default": "null", |
| 650 | "description": "Text to display to the left of the chart's y-axis. You can supply any HTML for this value, not just text. If you wish to style it using CSS, use the 'dygraph-label' or 'dygraph-ylabel' classes. The text will be rotated 90 degrees by default, so CSS rules may behave in unintuitive ways. No additional space is set aside for a y-axis label. If you need more space, increase the width of the y-axis tick labels using the yAxisLabelWidth option. If you need a wider div for the y-axis label, either style it that way with CSS (but remember that it's rotated, so width is controlled by the 'height' property) or set the yLabelWidth option." |
| 651 | }, |
| 652 | "y2label": { |
| 653 | "labels": ["Chart labels"], |
| 654 | "type": "string", |
| 655 | "default": "null", |
| 656 | "description": "Text to display to the right of the chart's secondary y-axis. This label is only displayed if a secondary y-axis is present. See <a href='http://dygraphs.com/tests/two-axes.html'>this test</a> for an example of how to do this. The comments for the 'ylabel' option generally apply here as well. This label gets a 'dygraph-y2label' instead of a 'dygraph-ylabel' class." |
| 657 | }, |
| 658 | "yLabelWidth": { |
| 659 | "labels": ["Chart labels"], |
| 660 | "type": "integer", |
| 661 | "default": "18", |
| 662 | "description": "Width of the div which contains the y-axis label. Since the y-axis label appears rotated 90 degrees, this actually affects the height of its div." |
| 663 | }, |
| 664 | "isZoomedIgnoreProgrammaticZoom" : { |
| 665 | "default": "false", |
| 666 | "labels": ["Zooming"], |
| 667 | "type": "boolean", |
| 668 | "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." |
| 669 | }, |
| 670 | "drawXGrid": { |
| 671 | "default": "true", |
| 672 | "labels": ["Grid","Deprecated"], |
| 673 | "type": "boolean", |
| 674 | "description" : "Use the per-axis option drawGrid instead. Whether to display vertical gridlines under the chart." |
| 675 | }, |
| 676 | "drawYGrid": { |
| 677 | "default": "true", |
| 678 | "labels": ["Grid","Deprecated"], |
| 679 | "type": "boolean", |
| 680 | "description" : "Use the per-axis option drawGrid instead. Whether to display horizontal gridlines under the chart." |
| 681 | }, |
| 682 | "drawGrid": { |
| 683 | "default": "true for x and y, false for y2", |
| 684 | "labels": ["Grid"], |
| 685 | "type": "boolean", |
| 686 | "description" : "Whether to display gridlines in the chart. This may be set on a per-axis basis to define the visibility of each axis' grid separately." |
| 687 | }, |
| 688 | "independentTicks": { |
| 689 | "default": "true for y, false for y2", |
| 690 | "labels": ["Axis display", "Grid"], |
| 691 | "type": "boolean", |
| 692 | "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." |
| 693 | }, |
| 694 | "drawXAxis": { |
| 695 | "default": "true", |
| 696 | "labels": ["Axis display"], |
| 697 | "type": "boolean", |
| 698 | "description" : "Deprecated. Use axes : { x : { drawAxis } }." |
| 699 | }, |
| 700 | "drawYAxis": { |
| 701 | "default": "true", |
| 702 | "labels": ["Axis display"], |
| 703 | "type": "boolean", |
| 704 | "description" : "Deprecated. Use axes : { y : { drawAxis } }." |
| 705 | }, |
| 706 | "drawAxis": { |
| 707 | "default": "true for x and y, false for y2", |
| 708 | "labels": ["Axis display"], |
| 709 | "type": "boolean", |
| 710 | "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." |
| 711 | }, |
| 712 | "gridLineWidth": { |
| 713 | "default": "0.3", |
| 714 | "labels": ["Grid"], |
| 715 | "type": "float", |
| 716 | "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." |
| 717 | }, |
| 718 | "axisLineWidth": { |
| 719 | "default": "0.3", |
| 720 | "labels": ["Axis display"], |
| 721 | "type": "float", |
| 722 | "description" : "Thickness (in pixels) of the x- and y-axis lines." |
| 723 | }, |
| 724 | "axisLineColor": { |
| 725 | "default": "black", |
| 726 | "labels": ["Axis display"], |
| 727 | "type": "string", |
| 728 | "description" : "Color of the x- and y-axis lines. Accepts any value which the HTML canvas strokeStyle attribute understands, e.g. 'black' or 'rgb(0, 100, 255)'." |
| 729 | }, |
| 730 | "fillAlpha": { |
| 731 | "default": "0.15", |
| 732 | "labels": ["Error Bars", "Data Series Colors"], |
| 733 | "type": "float (0.0 - 1.0)", |
| 734 | "description" : "Error bars (or custom bars) for each series are drawn in the same color as the series, but with partial transparency. This sets the transparency. A value of 0.0 means that the error bars will not be drawn, whereas a value of 1.0 means that the error bars will be as dark as the line for the series itself. This can be used to produce chart lines whose thickness varies at each point." |
| 735 | }, |
| 736 | "axisLabelColor": { |
| 737 | "default": "black", |
| 738 | "labels": ["Axis display"], |
| 739 | "type": "string", |
| 740 | "description" : "Color for x- and y-axis labels. This is a CSS color string." |
| 741 | }, |
| 742 | "axisLabelWidth": { |
| 743 | "default": "50", |
| 744 | "labels": ["Axis display", "Chart labels"], |
| 745 | "type": "integer", |
| 746 | "description" : "Width (in pixels) of the containing divs for x- and y-axis labels. For the y-axis, this also controls " |
| 747 | }, |
| 748 | "sigFigs" : { |
| 749 | "default": "null", |
| 750 | "labels": ["Value display/formatting"], |
| 751 | "type": "integer", |
| 752 | "description": "By default, dygraphs displays numbers with a fixed number of digits after the decimal point. If you'd prefer to have a fixed number of significant figures, set this option to that number of sig figs. A value of 2, for instance, would cause 1 to be display as 1.0 and 1234 to be displayed as 1.23e+3." |
| 753 | }, |
| 754 | "digitsAfterDecimal" : { |
| 755 | "default": "2", |
| 756 | "labels": ["Value display/formatting"], |
| 757 | "type": "integer", |
| 758 | "description": "Unless it's run in scientific mode (see the <code>sigFigs</code> option), dygraphs displays numbers with <code>digitsAfterDecimal</code> digits after the decimal point. Trailing zeros are not displayed, so with a value of 2 you'll get '0', '0.1', '0.12', '123.45' but not '123.456' (it will be rounded to '123.46'). Numbers with absolute value less than 0.1^digitsAfterDecimal (i.e. those which would show up as '0.00') will be displayed in scientific notation." |
| 759 | }, |
| 760 | "maxNumberWidth" : { |
| 761 | "default": "6", |
| 762 | "labels": ["Value display/formatting"], |
| 763 | "type": "integer", |
| 764 | "description": "When displaying numbers in normal (not scientific) mode, large numbers will be displayed with many trailing zeros (e.g. 100000000 instead of 1e9). This can lead to unwieldy y-axis labels. If there are more than <code>maxNumberWidth</code> digits to the left of the decimal in a number, dygraphs will switch to scientific notation, even when not operating in scientific mode. If you'd like to see all those digits, set this to something large, like 20 or 30." |
| 765 | }, |
| 766 | "file": { |
| 767 | "default": "(set when constructed)", |
| 768 | "labels": ["Data"], |
| 769 | "type": "string (URL of CSV or CSV), GViz DataTable or 2D Array", |
| 770 | "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." |
| 771 | }, |
| 772 | "timingName": { |
| 773 | "default": "null", |
| 774 | "labels": [ "Debugging" ], |
| 775 | "type": "string", |
| 776 | "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." |
| 777 | }, |
| 778 | "showRangeSelector": { |
| 779 | "default": "false", |
| 780 | "labels": ["Interactive Elements"], |
| 781 | "type": "boolean", |
| 782 | "description": "Show or hide the range selector widget." |
| 783 | }, |
| 784 | "rangeSelectorHeight": { |
| 785 | "default": "40", |
| 786 | "labels": ["Interactive Elements"], |
| 787 | "type": "integer", |
| 788 | "description": "Height, in pixels, of the range selector widget. This option can only be specified at Dygraph creation time." |
| 789 | }, |
| 790 | "rangeSelectorPlotStrokeColor": { |
| 791 | "default": "#808FAB", |
| 792 | "labels": ["Interactive Elements"], |
| 793 | "type": "string", |
| 794 | "description": "The range selector mini plot stroke color. This can be of the form \"#AABBCC\" or \"rgb(255,100,200)\" or \"yellow\". You can also specify null or \"\" to turn off stroke." |
| 795 | }, |
| 796 | "rangeSelectorPlotFillColor": { |
| 797 | "default": "#A7B1C4", |
| 798 | "labels": ["Interactive Elements"], |
| 799 | "type": "string", |
| 800 | "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." |
| 801 | }, |
| 802 | "animatedZooms": { |
| 803 | "default": "false", |
| 804 | "labels": ["Interactive Elements"], |
| 805 | "type": "boolean", |
| 806 | "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." |
| 807 | }, |
| 808 | "plotter": { |
| 809 | "default": "[DygraphCanvasRenderer.Plotters.fillPlotter, DygraphCanvasRenderer.Plotters.errorPlotter, DygraphCanvasRenderer.Plotters.linePlotter]", |
| 810 | "labels": ["Data Line display"], |
| 811 | "type": "array or function", |
| 812 | "description": "A function (or array of functions) which plot each data series on the chart. TODO(danvk): more details! May be set per-series." |
| 813 | }, |
| 814 | "series": { |
| 815 | "default": "null", |
| 816 | "labels": ["Series"], |
| 817 | "type": "Object", |
| 818 | "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." |
| 819 | }, |
| 820 | "plugins": { |
| 821 | "default": "[]", |
| 822 | "labels": ["Configuration"], |
| 823 | "type": "Array<plugin>", |
| 824 | "description": "Defines per-graph plugins. Useful for per-graph customization" |
| 825 | }, |
| 826 | "dataHandler": { |
| 827 | "default": "(depends on data)", |
| 828 | "labels": ["Data"], |
| 829 | "type": "Dygraph.DataHandler", |
| 830 | "description": "Custom DataHandler. This is an advanced customization. See http://bit.ly/151E7Aq." |
| 831 | } |
| 832 | } |
| 833 | ; // </JSON> |
| 834 | // NOTE: in addition to parsing as JS, this snippet is expected to be valid |
| 835 | // JSON. This assumption cannot be checked in JS, but it will be checked when |
| 836 | // documentation is generated by the generate-documentation.py script. For the |
| 837 | // most part, this just means that you should always use double quotes. |
| 838 | |
| 839 | // Do a quick sanity check on the options reference. |
| 840 | (function() { |
| 841 | "use strict"; |
| 842 | var warn = function(msg) { if (window.console) window.console.warn(msg); }; |
| 843 | var flds = ['type', 'default', 'description']; |
| 844 | var valid_cats = [ |
| 845 | 'Annotations', |
| 846 | 'Axis display', |
| 847 | 'Chart labels', |
| 848 | 'CSV parsing', |
| 849 | 'Callbacks', |
| 850 | 'Data', |
| 851 | 'Data Line display', |
| 852 | 'Data Series Colors', |
| 853 | 'Error Bars', |
| 854 | 'Grid', |
| 855 | 'Interactive Elements', |
| 856 | 'Legend', |
| 857 | 'Overall display', |
| 858 | 'Rolling Averages', |
| 859 | 'Series', |
| 860 | 'Value display/formatting', |
| 861 | 'Zooming', |
| 862 | 'Debugging', |
| 863 | 'Configuration', |
| 864 | 'Deprecated' |
| 865 | ]; |
| 866 | var i; |
| 867 | var cats = {}; |
| 868 | for (i = 0; i < valid_cats.length; i++) cats[valid_cats[i]] = true; |
| 869 | |
| 870 | for (var k in Dygraph.OPTIONS_REFERENCE) { |
| 871 | if (!Dygraph.OPTIONS_REFERENCE.hasOwnProperty(k)) continue; |
| 872 | var op = Dygraph.OPTIONS_REFERENCE[k]; |
| 873 | for (i = 0; i < flds.length; i++) { |
| 874 | if (!op.hasOwnProperty(flds[i])) { |
| 875 | warn('Option ' + k + ' missing "' + flds[i] + '" property'); |
| 876 | } else if (typeof(op[flds[i]]) != 'string') { |
| 877 | warn(k + '.' + flds[i] + ' must be of type string'); |
| 878 | } |
| 879 | } |
| 880 | var labels = op.labels; |
| 881 | if (typeof(labels) !== 'object') { |
| 882 | warn('Option "' + k + '" is missing a "labels": [...] option'); |
| 883 | } else { |
| 884 | for (i = 0; i < labels.length; i++) { |
| 885 | if (!cats.hasOwnProperty(labels[i])) { |
| 886 | warn('Option "' + k + '" has label "' + labels[i] + |
| 887 | '", which is invalid.'); |
| 888 | } |
| 889 | } |
| 890 | } |
| 891 | } |
| 892 | })(); |