1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en">
5 <meta http-equiv=
"content-type" content=
"text/html; charset=utf-8" />
6 <meta name=
"generator" content=
"JsDoc Toolkit" />
8 <title>JsDoc Reference - Dygraph
</title>
10 <style type=
"text/css">
14 font:
12px
"Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
21 background-color: #ccc;
36 border-top:
1px solid #
7F8FB1;
44 border:
1px dashed #ccc;
54 background-color: #F3F3F3;
66 list-style-type: none;
69 font-family: arial, sans-serif;
80 .summaryTable { width:
100%; }
88 h2 { font-size:
110%; }
89 caption, div.sectionTitle
91 background-color: #
7F8FB1;
95 padding:
2px
6px
2px
6px;
96 border:
1px #
7F8FB1 solid;
99 div.sectionTitle { margin-bottom:
8px; }
100 .summaryTable thead { display: none; }
106 border-bottom:
1px #
7F8FB1 solid;
107 border-right:
1px #
7F8FB1 solid;
110 /*col#summaryAttributes {}*/
111 .summaryTable td.attributes
113 border-left:
1px #
7F8FB1 solid;
118 td.attributes, .fixedFont
122 font-family:
"Courier New",Courier,monospace;
126 .summaryTable td.nameDescription
133 .summaryTable td.nameDescription, .description
140 .summaryTable { margin-bottom:
8px; }
153 .detailList dt { margin-left:
20px; }
162 .light, td.attributes, .light a:link, .light a:visited
177 <!-- ============================== header ================================= --
>
178 <!-- begin static/header.html --
>
181 <!-- end static/header.html --
>
183 <!-- ============================== classes index ============================ --
>
185 <!-- begin publish.classesIndex --
>
186 <div align=
"center"><a href=
"../index.html">Class Index
</a>
187 |
<a href=
"../files.html">File Index
</a></div>
190 <ul class=
"classList">
192 <li><i><a href=
"../symbols/_global_.html">_global_
</a></i></li>
194 <li><a href=
"../symbols/Dygraph.html">Dygraph
</a></li>
198 <!-- end publish.classesIndex --
>
202 <!-- ============================== class title ============================ --
>
203 <h1 class=
"classTitle">
208 <!-- ============================== class summary ========================== --
>
209 <p class=
"description">
216 <br /><i>Defined in:
</i> <a href=
"../symbols/src/dygraph.js.html">dygraph.js
</a>.
220 <!-- ============================== constructor summary ==================== --
>
222 <table class=
"summaryTable" cellspacing=
"0" summary=
"A summary of the constructor documented in the class Dygraph.">
223 <caption>Class Summary
</caption>
226 <th scope=
"col">Constructor Attributes
</th>
227 <th scope=
"col">Constructor Name and Description
</th>
232 <td class=
"attributes"> </td>
233 <td class=
"nameDescription" >
234 <div class=
"fixedFont">
235 <b><a href=
"../symbols/Dygraph.html#constructor">Dygraph
</a></b>(div, file, attrs)
237 <div class=
"description">Creates an interactive, zoomable chart.
</div>
244 <!-- ============================== properties summary ===================== --
>
248 <table class=
"summaryTable" cellspacing=
"0" summary=
"A summary of the fields documented in the class Dygraph.">
249 <caption>Field Summary
</caption>
252 <th scope=
"col">Field Attributes
</th>
253 <th scope=
"col">Field Name and Description
</th>
259 <td class=
"attributes"><static
> </td>
260 <td class=
"nameDescription">
261 <div class=
"fixedFont">
262 Dygraph.
<b><a href=
"../symbols/Dygraph.html#.defaultInteractionModel">defaultInteractionModel
</a></b>
264 <div class=
"description">Default interation model for dygraphs.
</div>
275 <!-- ============================== methods summary ======================== --
>
279 <table class=
"summaryTable" cellspacing=
"0" summary=
"A summary of the methods documented in the class Dygraph.">
280 <caption>Method Summary
</caption>
283 <th scope=
"col">Method Attributes
</th>
284 <th scope=
"col">Method Name and Description
</th>
290 <td class=
"attributes"> </td>
291 <td class=
"nameDescription">
292 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#adjustRoll">adjustRoll
</a></b>(length)
294 <div class=
"description">Adjusts the number of points in the rolling average.
</div>
299 <td class=
"attributes"> </td>
300 <td class=
"nameDescription">
301 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#annotations">annotations
</a></b>()
303 <div class=
"description">Return the list of annotations.
</div>
308 <td class=
"attributes"> </td>
309 <td class=
"nameDescription">
310 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#clearSelection">clearSelection
</a></b>()
312 <div class=
"description">Clears the current selection (i.e.
</div>
317 <td class=
"attributes"><static
> </td>
318 <td class=
"nameDescription">
319 <div class=
"fixedFont">Dygraph.
<b><a href=
"../symbols/Dygraph.html#.dateTicker">dateTicker
</a></b>(startDate, endDate, self)
321 <div class=
"description">Add ticks to the x-axis based on a date range.
</div>
326 <td class=
"attributes"> </td>
327 <td class=
"nameDescription">
328 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#destroy">destroy
</a></b>()
330 <div class=
"description">Detach DOM elements in the dygraph and null out all data references.
</div>
335 <td class=
"attributes"><static
> </td>
336 <td class=
"nameDescription">
337 <div class=
"fixedFont">Dygraph.
<b><a href=
"../symbols/Dygraph.html#.endPan">endPan
</a></b>(event, g, context)
339 <div class=
"description">Called in response to an interaction model operation that
340 responds to an event that ends panning.
</div>
345 <td class=
"attributes"><static
> </td>
346 <td class=
"nameDescription">
347 <div class=
"fixedFont">Dygraph.
<b><a href=
"../symbols/Dygraph.html#.endZoom">endZoom
</a></b>(event, g, context)
349 <div class=
"description">Called in response to an interaction model operation that
350 responds to an event that performs a zoom based on previously defined
356 <td class=
"attributes"><static
> </td>
357 <td class=
"nameDescription">
358 <div class=
"fixedFont">Dygraph.
<b><a href=
"../symbols/Dygraph.html#.floatFormat">floatFormat
</a></b>(x, opt_precision)
360 <div class=
"description">Number formatting function which mimicks the behavior of %g in printf, i.e.
</div>
365 <td class=
"attributes"> </td>
366 <td class=
"nameDescription">
367 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#getColors">getColors
</a></b>()
369 <div class=
"description">Return the list of colors.
</div>
374 <td class=
"attributes"> </td>
375 <td class=
"nameDescription">
376 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#getSelection">getSelection
</a></b>()
378 <div class=
"description">Returns the number of the currently selected row.
</div>
383 <td class=
"attributes"> </td>
384 <td class=
"nameDescription">
385 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#getValue">getValue
</a></b>(row, col)
387 <div class=
"description">Returns the value in the given row and column.
</div>
392 <td class=
"attributes"><static
> </td>
393 <td class=
"nameDescription">
394 <div class=
"fixedFont">Dygraph.
<b><a href=
"../symbols/Dygraph.html#.GVizChart">GVizChart
</a></b>(container)
396 <div class=
"description">A wrapper around Dygraph that implements the gviz API.
</div>
401 <td class=
"attributes"> </td>
402 <td class=
"nameDescription">
403 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#indexFromSetName">indexFromSetName
</a></b>(name)
405 <div class=
"description">Get the index of a series (column) given its name.
</div>
410 <td class=
"attributes"> </td>
411 <td class=
"nameDescription">
412 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#isZoomed">isZoomed
</a></b>(axis)
414 <div class=
"description">Returns the zoomed status of the chart for one or both axes.
</div>
419 <td class=
"attributes"><static
> </td>
420 <td class=
"nameDescription">
421 <div class=
"fixedFont">Dygraph.
<b><a href=
"../symbols/Dygraph.html#.movePan">movePan
</a></b>(event, g, context)
423 <div class=
"description">Called in response to an interaction model operation that
424 responds to an event that pans the view.
</div>
429 <td class=
"attributes"><static
> </td>
430 <td class=
"nameDescription">
431 <div class=
"fixedFont">Dygraph.
<b><a href=
"../symbols/Dygraph.html#.moveZoom">moveZoom
</a></b>(event, g, context)
433 <div class=
"description">Called in response to an interaction model operation that
434 responds to an event that defines zoom boundaries.
</div>
439 <td class=
"attributes"> </td>
440 <td class=
"nameDescription">
441 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#numAxes">numAxes
</a></b>()
443 <div class=
"description">Returns the number of y-axes on the chart.
</div>
448 <td class=
"attributes"> </td>
449 <td class=
"nameDescription">
450 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#numColumns">numColumns
</a></b>()
452 <div class=
"description">Returns the number of columns (including the independent variable).
</div>
457 <td class=
"attributes"><static
> </td>
458 <td class=
"nameDescription">
459 <div class=
"fixedFont">Dygraph.
<b><a href=
"../symbols/Dygraph.html#.numericTicks">numericTicks
</a></b>(minV, maxV, self, attribute, vals)
461 <div class=
"description">Add ticks when the x axis has numbers on it (instead of dates)
</div>
466 <td class=
"attributes"> </td>
467 <td class=
"nameDescription">
468 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#numRows">numRows
</a></b>()
470 <div class=
"description">Returns the number of rows (excluding any header/label row).
</div>
475 <td class=
"attributes"> </td>
476 <td class=
"nameDescription">
477 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#resize">resize
</a></b>(width, height)
479 <div class=
"description">Resizes the dygraph.
</div>
484 <td class=
"attributes"> </td>
485 <td class=
"nameDescription">
486 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#rollPeriod">rollPeriod
</a></b>()
488 <div class=
"description">Returns the current rolling period, as set by the user or an option.
</div>
493 <td class=
"attributes"> </td>
494 <td class=
"nameDescription">
495 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#setAnnotations">setAnnotations
</a></b>(ann, suppressDraw)
497 <div class=
"description">Update the list of annotations and redraw the chart.
</div>
502 <td class=
"attributes"> </td>
503 <td class=
"nameDescription">
504 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#setSelection">setSelection
</a></b>(row)
506 <div class=
"description">Manually set the selected points and display information about them in the
512 <td class=
"attributes"> </td>
513 <td class=
"nameDescription">
514 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#setVisibility">setVisibility
</a></b>(num, value)
516 <div class=
"description">Changes the visiblity of a series.
</div>
521 <td class=
"attributes"><static
> </td>
522 <td class=
"nameDescription">
523 <div class=
"fixedFont">Dygraph.
<b><a href=
"../symbols/Dygraph.html#.startPan">startPan
</a></b>(event, g, context)
525 <div class=
"description">Called in response to an interaction model operation that
526 should start the default panning behavior.
</div>
531 <td class=
"attributes"><static
> </td>
532 <td class=
"nameDescription">
533 <div class=
"fixedFont">Dygraph.
<b><a href=
"../symbols/Dygraph.html#.startZoom">startZoom
</a></b>(event, g, context)
535 <div class=
"description">Called in response to an interaction model operation that
536 responds to an event that starts zooming.
</div>
541 <td class=
"attributes"> </td>
542 <td class=
"nameDescription">
543 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#toDataCoords">toDataCoords
</a></b>(x, y, axis)
545 <div class=
"description">Convert from canvas/div coords to data coordinates.
</div>
550 <td class=
"attributes"> </td>
551 <td class=
"nameDescription">
552 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#toDataXCoord">toDataXCoord
</a></b>(x)
554 <div class=
"description">Convert from canvas/div x coordinate to data coordinate.
</div>
559 <td class=
"attributes"> </td>
560 <td class=
"nameDescription">
561 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#toDataYCoord">toDataYCoord
</a></b>(y, axis)
563 <div class=
"description">Convert from canvas/div y coord to value.
</div>
568 <td class=
"attributes"> </td>
569 <td class=
"nameDescription">
570 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#toDomCoords">toDomCoords
</a></b>(x, y, axis)
572 <div class=
"description">Convert from data coordinates to canvas/div X/Y coordinates.
</div>
577 <td class=
"attributes"> </td>
578 <td class=
"nameDescription">
579 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#toDomXCoord">toDomXCoord
</a></b>(x)
581 <div class=
"description">Convert from data x coordinates to canvas/div X coordinate.
</div>
586 <td class=
"attributes"> </td>
587 <td class=
"nameDescription">
588 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#toDomYCoord">toDomYCoord
</a></b>(y, axis)
590 <div class=
"description">Convert from data x coordinates to canvas/div Y coordinate and optional
596 <td class=
"attributes"> </td>
597 <td class=
"nameDescription">
598 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#toPercentXCoord">toPercentXCoord
</a></b>(x)
600 <div class=
"description">Converts an x value to a percentage from the left to the right of
601 the drawing area.
</div>
606 <td class=
"attributes"> </td>
607 <td class=
"nameDescription">
608 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#toPercentYCoord">toPercentYCoord
</a></b>(y, axis)
610 <div class=
"description">Converts a y for an axis to a percentage from the top to the
611 bottom of the drawing area.
</div>
616 <td class=
"attributes"> </td>
617 <td class=
"nameDescription">
618 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#toString">toString
</a></b>()
620 <div class=
"description">Returns information about the Dygraph object, including its containing ID.
</div>
625 <td class=
"attributes"><static
> </td>
626 <td class=
"nameDescription">
627 <div class=
"fixedFont">Dygraph.
<b><a href=
"../symbols/Dygraph.html#.toString">toString
</a></b>()
629 <div class=
"description">Returns information about the Dygraph class.
</div>
634 <td class=
"attributes"> </td>
635 <td class=
"nameDescription">
636 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#updateOptions">updateOptions
</a></b>(attrs)
638 <div class=
"description">Changes various properties of the graph.
</div>
643 <td class=
"attributes"> </td>
644 <td class=
"nameDescription">
645 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#visibility">visibility
</a></b>()
647 <div class=
"description">Returns a boolean array of visibility statuses.
</div>
652 <td class=
"attributes"> </td>
653 <td class=
"nameDescription">
654 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#xAxisExtremes">xAxisExtremes
</a></b>()
656 <div class=
"description">Returns the lower- and upper-bound x-axis values of the
662 <td class=
"attributes"> </td>
663 <td class=
"nameDescription">
664 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#xAxisRange">xAxisRange
</a></b>()
666 <div class=
"description">Returns the currently-visible x-range.
</div>
671 <td class=
"attributes"> </td>
672 <td class=
"nameDescription">
673 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#yAxisRange">yAxisRange
</a></b>(idx)
675 <div class=
"description">Returns the currently-visible y-range for an axis.
</div>
680 <td class=
"attributes"> </td>
681 <td class=
"nameDescription">
682 <div class=
"fixedFont"><b><a href=
"../symbols/Dygraph.html#yAxisRanges">yAxisRanges
</a></b>()
684 <div class=
"description">Returns the currently-visible y-ranges for each axis.
</div>
694 <!-- ============================== events summary ======================== --
>
697 <!-- ============================== constructor details ==================== --
>
699 <div class=
"details"><a name=
"constructor"> </a>
700 <div class=
"sectionTitle">
704 <div class=
"fixedFont">
705 <b>Dygraph
</b>(div, file, attrs)
708 <div class=
"description">
709 Creates an interactive, zoomable chart.
717 <dl class=
"detailList">
718 <dt class=
"heading">Parameters:
</dt>
721 <span class=
"light fixedFont">{div | String}
</span> <b>div
</b>
724 <dd>A div or the id of a div into which to construct
728 <span class=
"light fixedFont">{String | Function}
</span> <b>file
</b>
731 <dd>A file containing CSV data or a function
732 that returns this data. The most basic expected format for each line is
733 "YYYY/MM/DD,val1,val2,...". For more information, see
734 http://dygraphs.com/data.html.
</dd>
737 <span class=
"light fixedFont">{Object}
</span> <b>attrs
</b>
740 <dd>Various other attributes, e.g. errorBars determines
741 whether the input data contains error ranges. For a complete list of
742 options, see http://dygraphs.com/options.html.
</dd>
756 <!-- ============================== field details ========================== --
>
758 <div class=
"sectionTitle">
762 <a name=
".defaultInteractionModel"> </a>
763 <div class=
"fixedFont"><static
>
766 <span class=
"light">Dygraph.
</span><b>defaultInteractionModel
</b>
769 <div class=
"description">
770 Default interation model for dygraphs. You can refer to specific elements of
771 this when constructing your own interaction model, e.g.:
774 mousedown: Dygraph.defaultInteractionModel.mousedown
792 <!-- ============================== method details ========================= --
>
794 <div class=
"sectionTitle">
798 <a name=
"adjustRoll"> </a>
799 <div class=
"fixedFont">
802 <b>adjustRoll
</b>(length)
805 <div class=
"description">
806 Adjusts the number of points in the rolling average. Updates the graph to
807 reflect the new averaging period.
815 <dl class=
"detailList">
816 <dt class=
"heading">Parameters:
</dt>
819 <span class=
"light fixedFont">{Number}
</span> <b>length
</b>
822 <dd>Number of points over which to average the data.
</dd>
835 <a name=
"annotations"> </a>
836 <div class=
"fixedFont">
842 <div class=
"description">
843 Return the list of annotations.
860 <a name=
"clearSelection"> </a>
861 <div class=
"fixedFont">
864 <b>clearSelection
</b>()
867 <div class=
"description">
868 Clears the current selection (i.e. points that were highlighted by moving
869 the mouse over the chart).
886 <a name=
".dateTicker"> </a>
887 <div class=
"fixedFont"><static
>
889 <span class=
"light">{[Object]}
</span>
890 <span class=
"light">Dygraph.
</span><b>dateTicker
</b>(startDate, endDate, self)
893 <div class=
"description">
894 Add ticks to the x-axis based on a date range.
902 <dl class=
"detailList">
903 <dt class=
"heading">Parameters:
</dt>
906 <span class=
"light fixedFont">{Number}
</span> <b>startDate
</b>
909 <dd>Start of the date window (millis since epoch)
</dd>
912 <span class=
"light fixedFont">{Number}
</span> <b>endDate
</b>
915 <dd>End of the date window (millis since epoch)
</dd>
918 <span class=
"light fixedFont">{
<a href=
"../symbols/Dygraph.html">Dygraph
</a>}
</span> <b>self
</b>
921 <dd>The dygraph object
</dd>
929 <dl class=
"detailList">
930 <dt class=
"heading">Returns:
</dt>
932 <dd><span class=
"light fixedFont">{[Object]}
</span> Array of {label, value} tuples.
</dd>
941 <a name=
"destroy"> </a>
942 <div class=
"fixedFont">
948 <div class=
"description">
949 Detach DOM elements in the dygraph and null out all data references.
950 Calling this when you're done with a dygraph can dramatically reduce memory
951 usage. See, e.g., the tests/perf.html example.
968 <a name=
".endPan"> </a>
969 <div class=
"fixedFont"><static
>
972 <span class=
"light">Dygraph.
</span><b>endPan
</b>(event, g, context)
975 <div class=
"description">
976 Called in response to an interaction model operation that
977 responds to an event that ends panning.
979 It's used in the default callback for
"mouseup" operations.
980 Custom interaction model builders can use it to provide the default
989 <dl class=
"detailList">
990 <dt class=
"heading">Parameters:
</dt>
993 <span class=
"light fixedFont">{Event}
</span> <b>event
</b>
996 <dd>the event object which led to the startZoom call.
</dd>
999 <span class=
"light fixedFont">{
<a href=
"../symbols/Dygraph.html">Dygraph
</a>}
</span> <b>g
</b>
1002 <dd>The dygraph on which to act.
</dd>
1005 <span class=
"light fixedFont">{Object}
</span> <b>context
</b>
1008 <dd>The dragging context object (with
1009 dragStartX/dragStartY/etc. properties). This function modifies the context.
</dd>
1022 <a name=
".endZoom"> </a>
1023 <div class=
"fixedFont"><static
>
1026 <span class=
"light">Dygraph.
</span><b>endZoom
</b>(event, g, context)
1029 <div class=
"description">
1030 Called in response to an interaction model operation that
1031 responds to an event that performs a zoom based on previously defined
1034 It's used in the default callback for
"mouseup" operations.
1035 Custom interaction model builders can use it to provide the default
1044 <dl class=
"detailList">
1045 <dt class=
"heading">Parameters:
</dt>
1048 <span class=
"light fixedFont">{Event}
</span> <b>event
</b>
1051 <dd>the event object which led to the endZoom call.
</dd>
1054 <span class=
"light fixedFont">{
<a href=
"../symbols/Dygraph.html">Dygraph
</a>}
</span> <b>g
</b>
1057 <dd>The dygraph on which to end the zoom.
</dd>
1060 <span class=
"light fixedFont">{Object}
</span> <b>context
</b>
1063 <dd>The dragging context object (with
1064 dragStartX/dragStartY/etc. properties). This function modifies the context.
</dd>
1077 <a name=
".floatFormat"> </a>
1078 <div class=
"fixedFont"><static
>
1080 <span class=
"light">{String}
</span>
1081 <span class=
"light">Dygraph.
</span><b>floatFormat
</b>(x, opt_precision)
1084 <div class=
"description">
1085 Number formatting function which mimicks the behavior of %g in printf, i.e.
1086 either exponential or fixed format (without trailing
0s) is used depending on
1087 the length of the generated string. The advantage of this format is that
1088 there is a predictable upper bound on the resulting string length,
1089 significant figures are not dropped, and normal numbers are not displayed in
1090 exponential notation.
1092 NOTE: JavaScript's native toPrecision() is NOT a drop-in replacement for %g.
1093 It creates strings which are too long for absolute values between
10^-
4 and
1094 10^-
6, e.g. '
0.00001' instead of '
1e-5'. See tests/number-format.html for
1103 <dl class=
"detailList">
1104 <dt class=
"heading">Parameters:
</dt>
1107 <span class=
"light fixedFont">{Number}
</span> <b>x
</b>
1110 <dd>The number to format
</dd>
1113 <span class=
"light fixedFont">{Number}
</span> <b>opt_precision
</b>
1116 <dd>The precision to use, default
2.
</dd>
1124 <dl class=
"detailList">
1125 <dt class=
"heading">Returns:
</dt>
1127 <dd><span class=
"light fixedFont">{String}
</span> A string formatted like %g in printf. The max generated
1128 string length should be precision +
6 (e.g
1.123e+300).
</dd>
1137 <a name=
"getColors"> </a>
1138 <div class=
"fixedFont">
1140 <span class=
"light">{Array
<string>}
</span>
1144 <div class=
"description">
1145 Return the list of colors. This is either the list of colors passed in the
1146 attributes or the autogenerated list of rgb(r,g,b) strings.
1158 <dl class=
"detailList">
1159 <dt class=
"heading">Returns:
</dt>
1161 <dd><span class=
"light fixedFont">{Array
<string>}
</span> The list of colors.
</dd>
1170 <a name=
"getSelection"> </a>
1171 <div class=
"fixedFont">
1173 <span class=
"light">{Integer}
</span>
1174 <b>getSelection
</b>()
1177 <div class=
"description">
1178 Returns the number of the currently selected row. To get data for this row,
1179 you can use the getValue method.
1191 <dl class=
"detailList">
1192 <dt class=
"heading">Returns:
</dt>
1194 <dd><span class=
"light fixedFont">{Integer}
</span> row number, or -
1 if nothing is selected
</dd>
1203 <a name=
"getValue"> </a>
1204 <div class=
"fixedFont">
1206 <span class=
"light">{Number}
</span>
1207 <b>getValue
</b>(row, col)
1210 <div class=
"description">
1211 Returns the value in the given row and column. If the row and column exceed
1212 the bounds on the data, returns null. Also returns null if the value is
1221 <dl class=
"detailList">
1222 <dt class=
"heading">Parameters:
</dt>
1225 <span class=
"light fixedFont">{Number}
</span> <b>row
</b>
1228 <dd>The row number of the data (
0-based). Row
0 is the
1229 first row of data, not a header row.
</dd>
1232 <span class=
"light fixedFont">{Number}
</span> <b>col
</b>
1235 <dd>The column number of the data (
0-based)
</dd>
1243 <dl class=
"detailList">
1244 <dt class=
"heading">Returns:
</dt>
1246 <dd><span class=
"light fixedFont">{Number}
</span> The value in the specified cell or null if the row/col
1247 were out of range.
</dd>
1256 <a name=
".GVizChart"> </a>
1257 <div class=
"fixedFont"><static
>
1260 <span class=
"light">Dygraph.
</span><b>GVizChart
</b>(container)
1263 <div class=
"description">
1264 A wrapper around Dygraph that implements the gviz API.
1272 <dl class=
"detailList">
1273 <dt class=
"heading">Parameters:
</dt>
1276 <span class=
"light fixedFont">{Object}
</span> <b>container
</b>
1279 <dd>The DOM object the visualization should live in.
</dd>
1292 <a name=
"indexFromSetName"> </a>
1293 <div class=
"fixedFont">
1296 <b>indexFromSetName
</b>(name)
1299 <div class=
"description">
1300 Get the index of a series (column) given its name. The first column is the
1301 x-axis, so the data series start with index
1.
1309 <dl class=
"detailList">
1310 <dt class=
"heading">Parameters:
</dt>
1329 <a name=
"isZoomed"> </a>
1330 <div class=
"fixedFont">
1333 <b>isZoomed
</b>(axis)
1336 <div class=
"description">
1337 Returns the zoomed status of the chart for one or both axes.
1339 Axis is an optional parameter. Can be set to 'x' or 'y'.
1341 The zoomed status for an axis is set whenever a user zooms using the mouse
1342 or when the dateWindow or valueRange are updated (unless the isZoomedIgnoreProgrammaticZoom
1343 option is also specified).
1351 <dl class=
"detailList">
1352 <dt class=
"heading">Parameters:
</dt>
1371 <a name=
".movePan"> </a>
1372 <div class=
"fixedFont"><static
>
1375 <span class=
"light">Dygraph.
</span><b>movePan
</b>(event, g, context)
1378 <div class=
"description">
1379 Called in response to an interaction model operation that
1380 responds to an event that pans the view.
1382 It's used in the default callback for
"mousemove" operations.
1383 Custom interaction model builders can use it to provide the default
1392 <dl class=
"detailList">
1393 <dt class=
"heading">Parameters:
</dt>
1396 <span class=
"light fixedFont">{Event}
</span> <b>event
</b>
1399 <dd>the event object which led to the movePan call.
</dd>
1402 <span class=
"light fixedFont">{
<a href=
"../symbols/Dygraph.html">Dygraph
</a>}
</span> <b>g
</b>
1405 <dd>The dygraph on which to act.
</dd>
1408 <span class=
"light fixedFont">{Object}
</span> <b>context
</b>
1411 <dd>The dragging context object (with
1412 dragStartX/dragStartY/etc. properties). This function modifies the context.
</dd>
1425 <a name=
".moveZoom"> </a>
1426 <div class=
"fixedFont"><static
>
1429 <span class=
"light">Dygraph.
</span><b>moveZoom
</b>(event, g, context)
1432 <div class=
"description">
1433 Called in response to an interaction model operation that
1434 responds to an event that defines zoom boundaries.
1436 It's used in the default callback for
"mousemove" operations.
1437 Custom interaction model builders can use it to provide the default
1446 <dl class=
"detailList">
1447 <dt class=
"heading">Parameters:
</dt>
1450 <span class=
"light fixedFont">{Event}
</span> <b>event
</b>
1453 <dd>the event object which led to the moveZoom call.
</dd>
1456 <span class=
"light fixedFont">{
<a href=
"../symbols/Dygraph.html">Dygraph
</a>}
</span> <b>g
</b>
1459 <dd>The dygraph on which to act.
</dd>
1462 <span class=
"light fixedFont">{Object}
</span> <b>context
</b>
1465 <dd>The dragging context object (with
1466 dragStartX/dragStartY/etc. properties). This function modifies the context.
</dd>
1479 <a name=
"numAxes"> </a>
1480 <div class=
"fixedFont">
1482 <span class=
"light">{Number}
</span>
1486 <div class=
"description">
1487 Returns the number of y-axes on the chart.
1499 <dl class=
"detailList">
1500 <dt class=
"heading">Returns:
</dt>
1502 <dd><span class=
"light fixedFont">{Number}
</span> the number of axes.
</dd>
1511 <a name=
"numColumns"> </a>
1512 <div class=
"fixedFont">
1514 <span class=
"light">{Integer}
</span>
1518 <div class=
"description">
1519 Returns the number of columns (including the independent variable).
1531 <dl class=
"detailList">
1532 <dt class=
"heading">Returns:
</dt>
1534 <dd><span class=
"light fixedFont">{Integer}
</span> The number of columns.
</dd>
1543 <a name=
".numericTicks"> </a>
1544 <div class=
"fixedFont"><static
>
1546 <span class=
"light">{[Object]}
</span>
1547 <span class=
"light">Dygraph.
</span><b>numericTicks
</b>(minV, maxV, self, attribute, vals)
1550 <div class=
"description">
1551 Add ticks when the x axis has numbers on it (instead of dates)
1559 <dl class=
"detailList">
1560 <dt class=
"heading">Parameters:
</dt>
1563 <span class=
"light fixedFont">{Number}
</span> <b>minV
</b>
1566 <dd>minimum value
</dd>
1569 <span class=
"light fixedFont">{Number}
</span> <b>maxV
</b>
1572 <dd>maximum value
</dd>
1581 <span class=
"light fixedFont">{function}
</span> <b>attribute
</b>
1584 <dd>accessor function.
</dd>
1598 <dl class=
"detailList">
1599 <dt class=
"heading">Returns:
</dt>
1601 <dd><span class=
"light fixedFont">{[Object]}
</span> Array of {label, value} tuples.
</dd>
1610 <a name=
"numRows"> </a>
1611 <div class=
"fixedFont">
1613 <span class=
"light">{Integer}
</span>
1617 <div class=
"description">
1618 Returns the number of rows (excluding any header/label row).
1630 <dl class=
"detailList">
1631 <dt class=
"heading">Returns:
</dt>
1633 <dd><span class=
"light fixedFont">{Integer}
</span> The number of rows, less any header.
</dd>
1642 <a name=
"resize"> </a>
1643 <div class=
"fixedFont">
1646 <b>resize
</b>(width, height)
1649 <div class=
"description">
1650 Resizes the dygraph. If no parameters are specified, resizes to fill the
1651 containing div (which has presumably changed size since the dygraph was
1652 instantiated. If the width/height are specified, the div will be resized.
1654 This is far more efficient than destroying and re-instantiating a
1655 Dygraph, since it doesn't have to reparse the underlying data.
1663 <dl class=
"detailList">
1664 <dt class=
"heading">Parameters:
</dt>
1667 <span class=
"light fixedFont">{Number}
</span> <b>width
</b>
1670 <dd>Width (in pixels)
</dd>
1673 <span class=
"light fixedFont">{Number}
</span> <b>height
</b>
1676 <dd>Height (in pixels)
</dd>
1689 <a name=
"rollPeriod"> </a>
1690 <div class=
"fixedFont">
1692 <span class=
"light">{Number}
</span>
1696 <div class=
"description">
1697 Returns the current rolling period, as set by the user or an option.
1709 <dl class=
"detailList">
1710 <dt class=
"heading">Returns:
</dt>
1712 <dd><span class=
"light fixedFont">{Number}
</span> The number of points in the rolling window
</dd>
1721 <a name=
"setAnnotations"> </a>
1722 <div class=
"fixedFont">
1725 <b>setAnnotations
</b>(ann, suppressDraw)
1728 <div class=
"description">
1729 Update the list of annotations and redraw the chart.
1737 <dl class=
"detailList">
1738 <dt class=
"heading">Parameters:
</dt>
1763 <a name=
"setSelection"> </a>
1764 <div class=
"fixedFont">
1767 <b>setSelection
</b>(row)
1770 <div class=
"description">
1771 Manually set the selected points and display information about them in the
1772 legend. The selection can be cleared using clearSelection() and queried
1773 using getSelection().
1781 <dl class=
"detailList">
1782 <dt class=
"heading">Parameters:
</dt>
1785 <span class=
"light fixedFont">{Integer}
</span> <b>row
</b>
1788 <dd>number that should be highlighted (i.e. appear with
1789 hover dots on the chart). Set to false to clear any selection.
</dd>
1802 <a name=
"setVisibility"> </a>
1803 <div class=
"fixedFont">
1806 <b>setVisibility
</b>(num, value)
1809 <div class=
"description">
1810 Changes the visiblity of a series.
1818 <dl class=
"detailList">
1819 <dt class=
"heading">Parameters:
</dt>
1844 <a name=
".startPan"> </a>
1845 <div class=
"fixedFont"><static
>
1848 <span class=
"light">Dygraph.
</span><b>startPan
</b>(event, g, context)
1851 <div class=
"description">
1852 Called in response to an interaction model operation that
1853 should start the default panning behavior.
1855 It's used in the default callback for
"mousedown" operations.
1856 Custom interaction model builders can use it to provide the default
1865 <dl class=
"detailList">
1866 <dt class=
"heading">Parameters:
</dt>
1869 <span class=
"light fixedFont">{Event}
</span> <b>event
</b>
1872 <dd>the event object which led to the startPan call.
</dd>
1875 <span class=
"light fixedFont">{
<a href=
"../symbols/Dygraph.html">Dygraph
</a>}
</span> <b>g
</b>
1878 <dd>The dygraph on which to act.
</dd>
1881 <span class=
"light fixedFont">{Object}
</span> <b>context
</b>
1884 <dd>The dragging context object (with
1885 dragStartX/dragStartY/etc. properties). This function modifies the context.
</dd>
1898 <a name=
".startZoom"> </a>
1899 <div class=
"fixedFont"><static
>
1902 <span class=
"light">Dygraph.
</span><b>startZoom
</b>(event, g, context)
1905 <div class=
"description">
1906 Called in response to an interaction model operation that
1907 responds to an event that starts zooming.
1909 It's used in the default callback for
"mousedown" operations.
1910 Custom interaction model builders can use it to provide the default
1919 <dl class=
"detailList">
1920 <dt class=
"heading">Parameters:
</dt>
1923 <span class=
"light fixedFont">{Event}
</span> <b>event
</b>
1926 <dd>the event object which led to the startZoom call.
</dd>
1929 <span class=
"light fixedFont">{
<a href=
"../symbols/Dygraph.html">Dygraph
</a>}
</span> <b>g
</b>
1932 <dd>The dygraph on which to act.
</dd>
1935 <span class=
"light fixedFont">{Object}
</span> <b>context
</b>
1938 <dd>The dragging context object (with
1939 dragStartX/dragStartY/etc. properties). This function modifies the context.
</dd>
1952 <a name=
"toDataCoords"> </a>
1953 <div class=
"fixedFont">
1956 <b>toDataCoords
</b>(x, y, axis)
1959 <div class=
"description">
1960 Convert from canvas/div coords to data coordinates.
1961 If specified, do this conversion for the coordinate system of a particular
1962 axis. Uses the first axis by default.
1963 Returns a two-element array: [X, Y].
1965 Note: use toDataXCoord instead of toDataCoords(x, null) and use toDataYCoord
1966 instead of toDataCoords(null, y, axis).
1974 <dl class=
"detailList">
1975 <dt class=
"heading">Parameters:
</dt>
2006 <a name=
"toDataXCoord"> </a>
2007 <div class=
"fixedFont">
2010 <b>toDataXCoord
</b>(x)
2013 <div class=
"description">
2014 Convert from canvas/div x coordinate to data coordinate.
2016 If x is null, this returns null.
2024 <dl class=
"detailList">
2025 <dt class=
"heading">Parameters:
</dt>
2044 <a name=
"toDataYCoord"> </a>
2045 <div class=
"fixedFont">
2048 <b>toDataYCoord
</b>(y, axis)
2051 <div class=
"description">
2052 Convert from canvas/div y coord to value.
2054 If y is null, this returns null.
2055 if axis is null, this uses the first axis.
2063 <dl class=
"detailList">
2064 <dt class=
"heading">Parameters:
</dt>
2089 <a name=
"toDomCoords"> </a>
2090 <div class=
"fixedFont">
2093 <b>toDomCoords
</b>(x, y, axis)
2096 <div class=
"description">
2097 Convert from data coordinates to canvas/div X/Y coordinates.
2098 If specified, do this conversion for the coordinate system of a particular
2099 axis. Uses the first axis by default.
2100 Returns a two-element array: [X, Y]
2102 Note: use toDomXCoord instead of toDomCoords(x, null) and use toDomYCoord
2103 instead of toDomCoords(null, y, axis).
2111 <dl class=
"detailList">
2112 <dt class=
"heading">Parameters:
</dt>
2143 <a name=
"toDomXCoord"> </a>
2144 <div class=
"fixedFont">
2147 <b>toDomXCoord
</b>(x)
2150 <div class=
"description">
2151 Convert from data x coordinates to canvas/div X coordinate.
2152 If specified, do this conversion for the coordinate system of a particular
2154 Returns a single value or null if x is null.
2162 <dl class=
"detailList">
2163 <dt class=
"heading">Parameters:
</dt>
2182 <a name=
"toDomYCoord"> </a>
2183 <div class=
"fixedFont">
2186 <b>toDomYCoord
</b>(y, axis)
2189 <div class=
"description">
2190 Convert from data x coordinates to canvas/div Y coordinate and optional
2191 axis. Uses the first axis by default.
2193 returns a single value or null if y is null.
2201 <dl class=
"detailList">
2202 <dt class=
"heading">Parameters:
</dt>
2227 <a name=
"toPercentXCoord"> </a>
2228 <div class=
"fixedFont">
2230 <span class=
"light">{Number}
</span>
2231 <b>toPercentXCoord
</b>(x)
2234 <div class=
"description">
2235 Converts an x value to a percentage from the left to the right of
2238 If the coordinate represents a value visible on the canvas, then
2239 the value will be between
0 and
1, where
0 is the left of the canvas.
2240 However, this method will return values outside the range, as
2241 values can fall outside the canvas.
2243 If x is null, this returns null.
2251 <dl class=
"detailList">
2252 <dt class=
"heading">Parameters:
</dt>
2255 <span class=
"light fixedFont">{Number}
</span> <b>x
</b>
2258 <dd>The data x-coordinate.
</dd>
2266 <dl class=
"detailList">
2267 <dt class=
"heading">Returns:
</dt>
2269 <dd><span class=
"light fixedFont">{Number}
</span> A fraction in [
0,
1] where
0 = the left edge.
</dd>
2278 <a name=
"toPercentYCoord"> </a>
2279 <div class=
"fixedFont">
2281 <span class=
"light">{Number}
</span>
2282 <b>toPercentYCoord
</b>(y, axis)
2285 <div class=
"description">
2286 Converts a y for an axis to a percentage from the top to the
2287 bottom of the drawing area.
2289 If the coordinate represents a value visible on the canvas, then
2290 the value will be between
0 and
1, where
0 is the top of the canvas.
2291 However, this method will return values outside the range, as
2292 values can fall outside the canvas.
2294 If y is null, this returns null.
2295 if axis is null, this uses the first axis.
2303 <dl class=
"detailList">
2304 <dt class=
"heading">Parameters:
</dt>
2307 <span class=
"light fixedFont">{Number}
</span> <b>y
</b>
2310 <dd>The data y-coordinate.
</dd>
2313 <span class=
"light fixedFont">{Number}
</span> <b>axis
</b>
2316 <dd>The axis number on which the data coordinate lives.
</dd>
2324 <dl class=
"detailList">
2325 <dt class=
"heading">Returns:
</dt>
2327 <dd><span class=
"light fixedFont">{Number}
</span> A fraction in [
0,
1] where
0 = the top edge.
</dd>
2336 <a name=
"toString"> </a>
2337 <div class=
"fixedFont">
2343 <div class=
"description">
2344 Returns information about the Dygraph object, including its containing ID.
2361 <a name=
".toString"> </a>
2362 <div class=
"fixedFont"><static
>
2365 <span class=
"light">Dygraph.
</span><b>toString
</b>()
2368 <div class=
"description">
2369 Returns information about the Dygraph class.
2386 <a name=
"updateOptions"> </a>
2387 <div class=
"fixedFont">
2390 <b>updateOptions
</b>(attrs)
2393 <div class=
"description">
2394 Changes various properties of the graph. These can include:
2396 <li>file: changes the source data for the graph
</li>
2397 <li>errorBars: changes whether the data contains stddev
</li>
2406 <dl class=
"detailList">
2407 <dt class=
"heading">Parameters:
</dt>
2410 <span class=
"light fixedFont">{Object}
</span> <b>attrs
</b>
2413 <dd>The new properties and values
</dd>
2426 <a name=
"visibility"> </a>
2427 <div class=
"fixedFont">
2433 <div class=
"description">
2434 Returns a boolean array of visibility statuses.
2451 <a name=
"xAxisExtremes"> </a>
2452 <div class=
"fixedFont">
2455 <b>xAxisExtremes
</b>()
2458 <div class=
"description">
2459 Returns the lower- and upper-bound x-axis values of the
2477 <a name=
"xAxisRange"> </a>
2478 <div class=
"fixedFont">
2484 <div class=
"description">
2485 Returns the currently-visible x-range. This can be affected by zooming,
2486 panning or a call to updateOptions.
2487 Returns a two-element array: [left, right].
2488 If the Dygraph has dates on the x-axis, these will be millis since epoch.
2505 <a name=
"yAxisRange"> </a>
2506 <div class=
"fixedFont">
2509 <b>yAxisRange
</b>(idx)
2512 <div class=
"description">
2513 Returns the currently-visible y-range for an axis. This can be affected by
2514 zooming, panning or a call to updateOptions. Axis indices are zero-based. If
2515 called with no arguments, returns the range of the first axis.
2516 Returns a two-element array: [bottom, top].
2524 <dl class=
"detailList">
2525 <dt class=
"heading">Parameters:
</dt>
2544 <a name=
"yAxisRanges"> </a>
2545 <div class=
"fixedFont">
2548 <b>yAxisRanges
</b>()
2551 <div class=
"description">
2552 Returns the currently-visible y-ranges for each axis. This can be affected by
2553 zooming, panning, calls to updateOptions, etc.
2554 Returns an array of [bottom, top] pairs, one for each y-axis.
2573 <!-- ============================== event details ========================= --
>
2580 <!-- ============================== footer ================================= --
>
2581 <div class=
"fineprint" style=
"clear:both">
2583 Documentation generated by
<a href=
"http://code.google.com/p/jsdoc-toolkit/" target=
"_blank">JsDoc Toolkit
</a> 2.4.0 on Mon May
09 2011 07:
12:
49 GMT-
0700 (PDT)