can generate jsdoc; private methods marked as such
[dygraphs.git] / jsdoc-toolkit / out / jsdoc / symbols / Dygraph.html
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">
4 <head>
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="JsDoc Toolkit" />
7
8 <title>JsDoc Reference - Dygraph</title>
9
10 <style type="text/css">
11 /* default.css */
12 body
13 {
14 font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
15 width: 800px;
16 }
17
18 .header
19 {
20 clear: both;
21 background-color: #ccc;
22 padding: 8px;
23 }
24
25 h1
26 {
27 font-size: 150%;
28 font-weight: bold;
29 padding: 0;
30 margin: 1em 0 0 .3em;
31 }
32
33 hr
34 {
35 border: none 0;
36 border-top: 1px solid #7F8FB1;
37 height: 1px;
38 }
39
40 pre.code
41 {
42 display: block;
43 padding: 8px;
44 border: 1px dashed #ccc;
45 }
46
47 #index
48 {
49 margin-top: 24px;
50 float: left;
51 width: 160px;
52 position: absolute;
53 left: 8px;
54 background-color: #F3F3F3;
55 padding: 8px;
56 }
57
58 #content
59 {
60 margin-left: 190px;
61 width: 600px;
62 }
63
64 .classList
65 {
66 list-style-type: none;
67 padding: 0;
68 margin: 0 0 0 8px;
69 font-family: arial, sans-serif;
70 font-size: 1em;
71 overflow: auto;
72 }
73
74 .classList li
75 {
76 padding: 0;
77 margin: 0 0 8px 0;
78 }
79
80 .summaryTable { width: 100%; }
81
82 h1.classTitle
83 {
84 font-size:170%;
85 line-height:130%;
86 }
87
88 h2 { font-size: 110%; }
89 caption, div.sectionTitle
90 {
91 background-color: #7F8FB1;
92 color: #fff;
93 font-size:130%;
94 text-align: left;
95 padding: 2px 6px 2px 6px;
96 border: 1px #7F8FB1 solid;
97 }
98
99 div.sectionTitle { margin-bottom: 8px; }
100 .summaryTable thead { display: none; }
101
102 .summaryTable td
103 {
104 vertical-align: top;
105 padding: 4px;
106 border-bottom: 1px #7F8FB1 solid;
107 border-right: 1px #7F8FB1 solid;
108 }
109
110 /*col#summaryAttributes {}*/
111 .summaryTable td.attributes
112 {
113 border-left: 1px #7F8FB1 solid;
114 width: 140px;
115 text-align: right;
116 }
117
118 td.attributes, .fixedFont
119 {
120 line-height: 15px;
121 color: #002EBE;
122 font-family: "Courier New",Courier,monospace;
123 font-size: 13px;
124 }
125
126 .summaryTable td.nameDescription
127 {
128 text-align: left;
129 font-size: 13px;
130 line-height: 15px;
131 }
132
133 .summaryTable td.nameDescription, .description
134 {
135 line-height: 15px;
136 padding: 4px;
137 padding-left: 4px;
138 }
139
140 .summaryTable { margin-bottom: 8px; }
141
142 ul.inheritsList
143 {
144 list-style: square;
145 margin-left: 20px;
146 padding-left: 0;
147 }
148
149 .detailList {
150 margin-left: 20px;
151 line-height: 15px;
152 }
153 .detailList dt { margin-left: 20px; }
154
155 .detailList .heading
156 {
157 font-weight: bold;
158 padding-bottom: 6px;
159 margin-left: 0;
160 }
161
162 .light, td.attributes, .light a:link, .light a:visited
163 {
164 color: #777;
165 font-style: italic;
166 }
167
168 .fineprint
169 {
170 text-align: right;
171 font-size: 10px;
172 }
173 </style>
174 </head>
175
176 <body>
177 <!-- ============================== header ================================= -->
178 <!-- begin static/header.html -->
179 <div id="header">
180 </div>
181 <!-- end static/header.html -->
182
183 <!-- ============================== classes index ============================ -->
184 <div id="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>
188 <hr />
189 <h2>Classes</h2>
190 <ul class="classList">
191
192 <li><i><a href="../symbols/_global_.html">_global_</a></i></li>
193
194 <li><a href="../symbols/Dygraph.html">Dygraph</a></li>
195
196 </ul>
197 <hr />
198 <!-- end publish.classesIndex -->
199 </div>
200
201 <div id="content">
202 <!-- ============================== class title ============================ -->
203 <h1 class="classTitle">
204
205 Class Dygraph
206 </h1>
207
208 <!-- ============================== class summary ========================== -->
209 <p class="description">
210
211
212
213
214
215
216 <br /><i>Defined in: </i> <a href="../symbols/src/dygraph.js.html">dygraph.js</a>.
217
218 </p>
219
220 <!-- ============================== constructor summary ==================== -->
221
222 <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class Dygraph.">
223 <caption>Class Summary</caption>
224 <thead>
225 <tr>
226 <th scope="col">Constructor Attributes</th>
227 <th scope="col">Constructor Name and Description</th>
228 </tr>
229 </thead>
230 <tbody>
231 <tr>
232 <td class="attributes">&nbsp;</td>
233 <td class="nameDescription" >
234 <div class="fixedFont">
235 <b><a href="../symbols/Dygraph.html#constructor">Dygraph</a></b>(div, file, attrs)
236 </div>
237 <div class="description">Creates an interactive, zoomable chart.</div>
238 </td>
239 </tr>
240 </tbody>
241 </table>
242
243
244 <!-- ============================== properties summary ===================== -->
245
246
247
248 <table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class Dygraph.">
249 <caption>Field Summary</caption>
250 <thead>
251 <tr>
252 <th scope="col">Field Attributes</th>
253 <th scope="col">Field Name and Description</th>
254 </tr>
255 </thead>
256 <tbody>
257
258 <tr>
259 <td class="attributes">&lt;static&gt; &nbsp;</td>
260 <td class="nameDescription">
261 <div class="fixedFont">
262 Dygraph.<b><a href="../symbols/Dygraph.html#.defaultInteractionModel">defaultInteractionModel</a></b>
263 </div>
264 <div class="description">Default interation model for dygraphs.</div>
265 </td>
266 </tr>
267
268 </tbody>
269 </table>
270
271
272
273
274
275 <!-- ============================== methods summary ======================== -->
276
277
278
279 <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class Dygraph.">
280 <caption>Method Summary</caption>
281 <thead>
282 <tr>
283 <th scope="col">Method Attributes</th>
284 <th scope="col">Method Name and Description</th>
285 </tr>
286 </thead>
287 <tbody>
288
289 <tr>
290 <td class="attributes">&nbsp;</td>
291 <td class="nameDescription">
292 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#adjustRoll">adjustRoll</a></b>(length)
293 </div>
294 <div class="description">Adjusts the number of points in the rolling average.</div>
295 </td>
296 </tr>
297
298 <tr>
299 <td class="attributes">&nbsp;</td>
300 <td class="nameDescription">
301 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#annotations">annotations</a></b>()
302 </div>
303 <div class="description">Return the list of annotations.</div>
304 </td>
305 </tr>
306
307 <tr>
308 <td class="attributes">&nbsp;</td>
309 <td class="nameDescription">
310 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#clearSelection">clearSelection</a></b>()
311 </div>
312 <div class="description">Clears the current selection (i.e.</div>
313 </td>
314 </tr>
315
316 <tr>
317 <td class="attributes">&lt;static&gt; &nbsp;</td>
318 <td class="nameDescription">
319 <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.dateTicker">dateTicker</a></b>(startDate, endDate, self)
320 </div>
321 <div class="description">Add ticks to the x-axis based on a date range.</div>
322 </td>
323 </tr>
324
325 <tr>
326 <td class="attributes">&nbsp;</td>
327 <td class="nameDescription">
328 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#destroy">destroy</a></b>()
329 </div>
330 <div class="description">Detach DOM elements in the dygraph and null out all data references.</div>
331 </td>
332 </tr>
333
334 <tr>
335 <td class="attributes">&lt;static&gt; &nbsp;</td>
336 <td class="nameDescription">
337 <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.endPan">endPan</a></b>(event, g, context)
338 </div>
339 <div class="description">Called in response to an interaction model operation that
340 responds to an event that ends panning.</div>
341 </td>
342 </tr>
343
344 <tr>
345 <td class="attributes">&lt;static&gt; &nbsp;</td>
346 <td class="nameDescription">
347 <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.endZoom">endZoom</a></b>(event, g, context)
348 </div>
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
351 bounds.</div>
352 </td>
353 </tr>
354
355 <tr>
356 <td class="attributes">&lt;static&gt; &nbsp;</td>
357 <td class="nameDescription">
358 <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.floatFormat">floatFormat</a></b>(x, opt_precision)
359 </div>
360 <div class="description">Number formatting function which mimicks the behavior of %g in printf, i.e.</div>
361 </td>
362 </tr>
363
364 <tr>
365 <td class="attributes">&nbsp;</td>
366 <td class="nameDescription">
367 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#getColors">getColors</a></b>()
368 </div>
369 <div class="description">Return the list of colors.</div>
370 </td>
371 </tr>
372
373 <tr>
374 <td class="attributes">&nbsp;</td>
375 <td class="nameDescription">
376 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#getSelection">getSelection</a></b>()
377 </div>
378 <div class="description">Returns the number of the currently selected row.</div>
379 </td>
380 </tr>
381
382 <tr>
383 <td class="attributes">&nbsp;</td>
384 <td class="nameDescription">
385 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#getValue">getValue</a></b>(row, col)
386 </div>
387 <div class="description">Returns the value in the given row and column.</div>
388 </td>
389 </tr>
390
391 <tr>
392 <td class="attributes">&lt;static&gt; &nbsp;</td>
393 <td class="nameDescription">
394 <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.GVizChart">GVizChart</a></b>(container)
395 </div>
396 <div class="description">A wrapper around Dygraph that implements the gviz API.</div>
397 </td>
398 </tr>
399
400 <tr>
401 <td class="attributes">&nbsp;</td>
402 <td class="nameDescription">
403 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#indexFromSetName">indexFromSetName</a></b>(name)
404 </div>
405 <div class="description">Get the index of a series (column) given its name.</div>
406 </td>
407 </tr>
408
409 <tr>
410 <td class="attributes">&nbsp;</td>
411 <td class="nameDescription">
412 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#isZoomed">isZoomed</a></b>(axis)
413 </div>
414 <div class="description">Returns the zoomed status of the chart for one or both axes.</div>
415 </td>
416 </tr>
417
418 <tr>
419 <td class="attributes">&lt;static&gt; &nbsp;</td>
420 <td class="nameDescription">
421 <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.movePan">movePan</a></b>(event, g, context)
422 </div>
423 <div class="description">Called in response to an interaction model operation that
424 responds to an event that pans the view.</div>
425 </td>
426 </tr>
427
428 <tr>
429 <td class="attributes">&lt;static&gt; &nbsp;</td>
430 <td class="nameDescription">
431 <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.moveZoom">moveZoom</a></b>(event, g, context)
432 </div>
433 <div class="description">Called in response to an interaction model operation that
434 responds to an event that defines zoom boundaries.</div>
435 </td>
436 </tr>
437
438 <tr>
439 <td class="attributes">&nbsp;</td>
440 <td class="nameDescription">
441 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#numAxes">numAxes</a></b>()
442 </div>
443 <div class="description">Returns the number of y-axes on the chart.</div>
444 </td>
445 </tr>
446
447 <tr>
448 <td class="attributes">&nbsp;</td>
449 <td class="nameDescription">
450 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#numColumns">numColumns</a></b>()
451 </div>
452 <div class="description">Returns the number of columns (including the independent variable).</div>
453 </td>
454 </tr>
455
456 <tr>
457 <td class="attributes">&lt;static&gt; &nbsp;</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)
460 </div>
461 <div class="description">Add ticks when the x axis has numbers on it (instead of dates)</div>
462 </td>
463 </tr>
464
465 <tr>
466 <td class="attributes">&nbsp;</td>
467 <td class="nameDescription">
468 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#numRows">numRows</a></b>()
469 </div>
470 <div class="description">Returns the number of rows (excluding any header/label row).</div>
471 </td>
472 </tr>
473
474 <tr>
475 <td class="attributes">&nbsp;</td>
476 <td class="nameDescription">
477 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#resize">resize</a></b>(width, height)
478 </div>
479 <div class="description">Resizes the dygraph.</div>
480 </td>
481 </tr>
482
483 <tr>
484 <td class="attributes">&nbsp;</td>
485 <td class="nameDescription">
486 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#rollPeriod">rollPeriod</a></b>()
487 </div>
488 <div class="description">Returns the current rolling period, as set by the user or an option.</div>
489 </td>
490 </tr>
491
492 <tr>
493 <td class="attributes">&nbsp;</td>
494 <td class="nameDescription">
495 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#setAnnotations">setAnnotations</a></b>(ann, suppressDraw)
496 </div>
497 <div class="description">Update the list of annotations and redraw the chart.</div>
498 </td>
499 </tr>
500
501 <tr>
502 <td class="attributes">&nbsp;</td>
503 <td class="nameDescription">
504 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#setSelection">setSelection</a></b>(row)
505 </div>
506 <div class="description">Manually set the selected points and display information about them in the
507 legend.</div>
508 </td>
509 </tr>
510
511 <tr>
512 <td class="attributes">&nbsp;</td>
513 <td class="nameDescription">
514 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#setVisibility">setVisibility</a></b>(num, value)
515 </div>
516 <div class="description">Changes the visiblity of a series.</div>
517 </td>
518 </tr>
519
520 <tr>
521 <td class="attributes">&lt;static&gt; &nbsp;</td>
522 <td class="nameDescription">
523 <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.startPan">startPan</a></b>(event, g, context)
524 </div>
525 <div class="description">Called in response to an interaction model operation that
526 should start the default panning behavior.</div>
527 </td>
528 </tr>
529
530 <tr>
531 <td class="attributes">&lt;static&gt; &nbsp;</td>
532 <td class="nameDescription">
533 <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.startZoom">startZoom</a></b>(event, g, context)
534 </div>
535 <div class="description">Called in response to an interaction model operation that
536 responds to an event that starts zooming.</div>
537 </td>
538 </tr>
539
540 <tr>
541 <td class="attributes">&nbsp;</td>
542 <td class="nameDescription">
543 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDataCoords">toDataCoords</a></b>(x, y, axis)
544 </div>
545 <div class="description">Convert from canvas/div coords to data coordinates.</div>
546 </td>
547 </tr>
548
549 <tr>
550 <td class="attributes">&nbsp;</td>
551 <td class="nameDescription">
552 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDataXCoord">toDataXCoord</a></b>(x)
553 </div>
554 <div class="description">Convert from canvas/div x coordinate to data coordinate.</div>
555 </td>
556 </tr>
557
558 <tr>
559 <td class="attributes">&nbsp;</td>
560 <td class="nameDescription">
561 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDataYCoord">toDataYCoord</a></b>(y, axis)
562 </div>
563 <div class="description">Convert from canvas/div y coord to value.</div>
564 </td>
565 </tr>
566
567 <tr>
568 <td class="attributes">&nbsp;</td>
569 <td class="nameDescription">
570 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDomCoords">toDomCoords</a></b>(x, y, axis)
571 </div>
572 <div class="description">Convert from data coordinates to canvas/div X/Y coordinates.</div>
573 </td>
574 </tr>
575
576 <tr>
577 <td class="attributes">&nbsp;</td>
578 <td class="nameDescription">
579 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDomXCoord">toDomXCoord</a></b>(x)
580 </div>
581 <div class="description">Convert from data x coordinates to canvas/div X coordinate.</div>
582 </td>
583 </tr>
584
585 <tr>
586 <td class="attributes">&nbsp;</td>
587 <td class="nameDescription">
588 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDomYCoord">toDomYCoord</a></b>(y, axis)
589 </div>
590 <div class="description">Convert from data x coordinates to canvas/div Y coordinate and optional
591 axis.</div>
592 </td>
593 </tr>
594
595 <tr>
596 <td class="attributes">&nbsp;</td>
597 <td class="nameDescription">
598 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toPercentXCoord">toPercentXCoord</a></b>(x)
599 </div>
600 <div class="description">Converts an x value to a percentage from the left to the right of
601 the drawing area.</div>
602 </td>
603 </tr>
604
605 <tr>
606 <td class="attributes">&nbsp;</td>
607 <td class="nameDescription">
608 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toPercentYCoord">toPercentYCoord</a></b>(y, axis)
609 </div>
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>
612 </td>
613 </tr>
614
615 <tr>
616 <td class="attributes">&nbsp;</td>
617 <td class="nameDescription">
618 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toString">toString</a></b>()
619 </div>
620 <div class="description">Returns information about the Dygraph object, including its containing ID.</div>
621 </td>
622 </tr>
623
624 <tr>
625 <td class="attributes">&lt;static&gt; &nbsp;</td>
626 <td class="nameDescription">
627 <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.toString">toString</a></b>()
628 </div>
629 <div class="description">Returns information about the Dygraph class.</div>
630 </td>
631 </tr>
632
633 <tr>
634 <td class="attributes">&nbsp;</td>
635 <td class="nameDescription">
636 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#updateOptions">updateOptions</a></b>(attrs)
637 </div>
638 <div class="description">Changes various properties of the graph.</div>
639 </td>
640 </tr>
641
642 <tr>
643 <td class="attributes">&nbsp;</td>
644 <td class="nameDescription">
645 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#visibility">visibility</a></b>()
646 </div>
647 <div class="description">Returns a boolean array of visibility statuses.</div>
648 </td>
649 </tr>
650
651 <tr>
652 <td class="attributes">&nbsp;</td>
653 <td class="nameDescription">
654 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#xAxisExtremes">xAxisExtremes</a></b>()
655 </div>
656 <div class="description">Returns the lower- and upper-bound x-axis values of the
657 data set.</div>
658 </td>
659 </tr>
660
661 <tr>
662 <td class="attributes">&nbsp;</td>
663 <td class="nameDescription">
664 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#xAxisRange">xAxisRange</a></b>()
665 </div>
666 <div class="description">Returns the currently-visible x-range.</div>
667 </td>
668 </tr>
669
670 <tr>
671 <td class="attributes">&nbsp;</td>
672 <td class="nameDescription">
673 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#yAxisRange">yAxisRange</a></b>(idx)
674 </div>
675 <div class="description">Returns the currently-visible y-range for an axis.</div>
676 </td>
677 </tr>
678
679 <tr>
680 <td class="attributes">&nbsp;</td>
681 <td class="nameDescription">
682 <div class="fixedFont"><b><a href="../symbols/Dygraph.html#yAxisRanges">yAxisRanges</a></b>()
683 </div>
684 <div class="description">Returns the currently-visible y-ranges for each axis.</div>
685 </td>
686 </tr>
687
688 </tbody>
689 </table>
690
691
692
693
694 <!-- ============================== events summary ======================== -->
695
696
697 <!-- ============================== constructor details ==================== -->
698
699 <div class="details"><a name="constructor"> </a>
700 <div class="sectionTitle">
701 Class Detail
702 </div>
703
704 <div class="fixedFont">
705 <b>Dygraph</b>(div, file, attrs)
706 </div>
707
708 <div class="description">
709 Creates an interactive, zoomable chart.
710
711 </div>
712
713
714
715
716
717 <dl class="detailList">
718 <dt class="heading">Parameters:</dt>
719
720 <dt>
721 <span class="light fixedFont">{div | String}</span> <b>div</b>
722
723 </dt>
724 <dd>A div or the id of a div into which to construct
725 the chart.</dd>
726
727 <dt>
728 <span class="light fixedFont">{String | Function}</span> <b>file</b>
729
730 </dt>
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>
735
736 <dt>
737 <span class="light fixedFont">{Object}</span> <b>attrs</b>
738
739 </dt>
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>
743
744 </dl>
745
746
747
748
749
750
751
752
753 </div>
754
755
756 <!-- ============================== field details ========================== -->
757
758 <div class="sectionTitle">
759 Field Detail
760 </div>
761
762 <a name=".defaultInteractionModel"> </a>
763 <div class="fixedFont">&lt;static&gt;
764
765
766 <span class="light">Dygraph.</span><b>defaultInteractionModel</b>
767
768 </div>
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.:
772 g.updateOptions( {
773 interactionModel: {
774 mousedown: Dygraph.defaultInteractionModel.mousedown
775 }
776 } );
777
778
779 </div>
780
781
782
783
784
785
786
787
788
789
790
791
792 <!-- ============================== method details ========================= -->
793
794 <div class="sectionTitle">
795 Method Detail
796 </div>
797
798 <a name="adjustRoll"> </a>
799 <div class="fixedFont">
800
801
802 <b>adjustRoll</b>(length)
803
804 </div>
805 <div class="description">
806 Adjusts the number of points in the rolling average. Updates the graph to
807 reflect the new averaging period.
808
809
810 </div>
811
812
813
814
815 <dl class="detailList">
816 <dt class="heading">Parameters:</dt>
817
818 <dt>
819 <span class="light fixedFont">{Number}</span> <b>length</b>
820
821 </dt>
822 <dd>Number of points over which to average the data.</dd>
823
824 </dl>
825
826
827
828
829
830
831
832
833 <hr />
834
835 <a name="annotations"> </a>
836 <div class="fixedFont">
837
838
839 <b>annotations</b>()
840
841 </div>
842 <div class="description">
843 Return the list of annotations.
844
845
846 </div>
847
848
849
850
851
852
853
854
855
856
857
858 <hr />
859
860 <a name="clearSelection"> </a>
861 <div class="fixedFont">
862
863
864 <b>clearSelection</b>()
865
866 </div>
867 <div class="description">
868 Clears the current selection (i.e. points that were highlighted by moving
869 the mouse over the chart).
870
871
872 </div>
873
874
875
876
877
878
879
880
881
882
883
884 <hr />
885
886 <a name=".dateTicker"> </a>
887 <div class="fixedFont">&lt;static&gt;
888
889 <span class="light">{[Object]}</span>
890 <span class="light">Dygraph.</span><b>dateTicker</b>(startDate, endDate, self)
891
892 </div>
893 <div class="description">
894 Add ticks to the x-axis based on a date range.
895
896
897 </div>
898
899
900
901
902 <dl class="detailList">
903 <dt class="heading">Parameters:</dt>
904
905 <dt>
906 <span class="light fixedFont">{Number}</span> <b>startDate</b>
907
908 </dt>
909 <dd>Start of the date window (millis since epoch)</dd>
910
911 <dt>
912 <span class="light fixedFont">{Number}</span> <b>endDate</b>
913
914 </dt>
915 <dd>End of the date window (millis since epoch)</dd>
916
917 <dt>
918 <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>self</b>
919
920 </dt>
921 <dd>The dygraph object</dd>
922
923 </dl>
924
925
926
927
928
929 <dl class="detailList">
930 <dt class="heading">Returns:</dt>
931
932 <dd><span class="light fixedFont">{[Object]}</span> Array of {label, value} tuples.</dd>
933
934 </dl>
935
936
937
938
939 <hr />
940
941 <a name="destroy"> </a>
942 <div class="fixedFont">
943
944
945 <b>destroy</b>()
946
947 </div>
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.
952
953
954 </div>
955
956
957
958
959
960
961
962
963
964
965
966 <hr />
967
968 <a name=".endPan"> </a>
969 <div class="fixedFont">&lt;static&gt;
970
971
972 <span class="light">Dygraph.</span><b>endPan</b>(event, g, context)
973
974 </div>
975 <div class="description">
976 Called in response to an interaction model operation that
977 responds to an event that ends panning.
978
979 It's used in the default callback for "mouseup" operations.
980 Custom interaction model builders can use it to provide the default
981 panning behavior.
982
983
984 </div>
985
986
987
988
989 <dl class="detailList">
990 <dt class="heading">Parameters:</dt>
991
992 <dt>
993 <span class="light fixedFont">{Event}</span> <b>event</b>
994
995 </dt>
996 <dd>the event object which led to the startZoom call.</dd>
997
998 <dt>
999 <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
1000
1001 </dt>
1002 <dd>The dygraph on which to act.</dd>
1003
1004 <dt>
1005 <span class="light fixedFont">{Object}</span> <b>context</b>
1006
1007 </dt>
1008 <dd>The dragging context object (with
1009 dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
1010
1011 </dl>
1012
1013
1014
1015
1016
1017
1018
1019
1020 <hr />
1021
1022 <a name=".endZoom"> </a>
1023 <div class="fixedFont">&lt;static&gt;
1024
1025
1026 <span class="light">Dygraph.</span><b>endZoom</b>(event, g, context)
1027
1028 </div>
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
1032 bounds..
1033
1034 It's used in the default callback for "mouseup" operations.
1035 Custom interaction model builders can use it to provide the default
1036 zooming behavior.
1037
1038
1039 </div>
1040
1041
1042
1043
1044 <dl class="detailList">
1045 <dt class="heading">Parameters:</dt>
1046
1047 <dt>
1048 <span class="light fixedFont">{Event}</span> <b>event</b>
1049
1050 </dt>
1051 <dd>the event object which led to the endZoom call.</dd>
1052
1053 <dt>
1054 <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
1055
1056 </dt>
1057 <dd>The dygraph on which to end the zoom.</dd>
1058
1059 <dt>
1060 <span class="light fixedFont">{Object}</span> <b>context</b>
1061
1062 </dt>
1063 <dd>The dragging context object (with
1064 dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
1065
1066 </dl>
1067
1068
1069
1070
1071
1072
1073
1074
1075 <hr />
1076
1077 <a name=".floatFormat"> </a>
1078 <div class="fixedFont">&lt;static&gt;
1079
1080 <span class="light">{String}</span>
1081 <span class="light">Dygraph.</span><b>floatFormat</b>(x, opt_precision)
1082
1083 </div>
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.
1091
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
1095 output examples.
1096
1097
1098 </div>
1099
1100
1101
1102
1103 <dl class="detailList">
1104 <dt class="heading">Parameters:</dt>
1105
1106 <dt>
1107 <span class="light fixedFont">{Number}</span> <b>x</b>
1108
1109 </dt>
1110 <dd>The number to format</dd>
1111
1112 <dt>
1113 <span class="light fixedFont">{Number}</span> <b>opt_precision</b>
1114
1115 </dt>
1116 <dd>The precision to use, default 2.</dd>
1117
1118 </dl>
1119
1120
1121
1122
1123
1124 <dl class="detailList">
1125 <dt class="heading">Returns:</dt>
1126
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>
1129
1130 </dl>
1131
1132
1133
1134
1135 <hr />
1136
1137 <a name="getColors"> </a>
1138 <div class="fixedFont">
1139
1140 <span class="light">{Array<string>}</span>
1141 <b>getColors</b>()
1142
1143 </div>
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.
1147
1148
1149 </div>
1150
1151
1152
1153
1154
1155
1156
1157
1158 <dl class="detailList">
1159 <dt class="heading">Returns:</dt>
1160
1161 <dd><span class="light fixedFont">{Array<string>}</span> The list of colors.</dd>
1162
1163 </dl>
1164
1165
1166
1167
1168 <hr />
1169
1170 <a name="getSelection"> </a>
1171 <div class="fixedFont">
1172
1173 <span class="light">{Integer}</span>
1174 <b>getSelection</b>()
1175
1176 </div>
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.
1180
1181
1182 </div>
1183
1184
1185
1186
1187
1188
1189
1190
1191 <dl class="detailList">
1192 <dt class="heading">Returns:</dt>
1193
1194 <dd><span class="light fixedFont">{Integer}</span> row number, or -1 if nothing is selected</dd>
1195
1196 </dl>
1197
1198
1199
1200
1201 <hr />
1202
1203 <a name="getValue"> </a>
1204 <div class="fixedFont">
1205
1206 <span class="light">{Number}</span>
1207 <b>getValue</b>(row, col)
1208
1209 </div>
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
1213 missing.
1214
1215
1216 </div>
1217
1218
1219
1220
1221 <dl class="detailList">
1222 <dt class="heading">Parameters:</dt>
1223
1224 <dt>
1225 <span class="light fixedFont">{Number}</span> <b>row</b>
1226
1227 </dt>
1228 <dd>The row number of the data (0-based). Row 0 is the
1229 first row of data, not a header row.</dd>
1230
1231 <dt>
1232 <span class="light fixedFont">{Number}</span> <b>col</b>
1233
1234 </dt>
1235 <dd>The column number of the data (0-based)</dd>
1236
1237 </dl>
1238
1239
1240
1241
1242
1243 <dl class="detailList">
1244 <dt class="heading">Returns:</dt>
1245
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>
1248
1249 </dl>
1250
1251
1252
1253
1254 <hr />
1255
1256 <a name=".GVizChart"> </a>
1257 <div class="fixedFont">&lt;static&gt;
1258
1259
1260 <span class="light">Dygraph.</span><b>GVizChart</b>(container)
1261
1262 </div>
1263 <div class="description">
1264 A wrapper around Dygraph that implements the gviz API.
1265
1266
1267 </div>
1268
1269
1270
1271
1272 <dl class="detailList">
1273 <dt class="heading">Parameters:</dt>
1274
1275 <dt>
1276 <span class="light fixedFont">{Object}</span> <b>container</b>
1277
1278 </dt>
1279 <dd>The DOM object the visualization should live in.</dd>
1280
1281 </dl>
1282
1283
1284
1285
1286
1287
1288
1289
1290 <hr />
1291
1292 <a name="indexFromSetName"> </a>
1293 <div class="fixedFont">
1294
1295
1296 <b>indexFromSetName</b>(name)
1297
1298 </div>
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.
1302
1303
1304 </div>
1305
1306
1307
1308
1309 <dl class="detailList">
1310 <dt class="heading">Parameters:</dt>
1311
1312 <dt>
1313 <b>name</b>
1314
1315 </dt>
1316 <dd></dd>
1317
1318 </dl>
1319
1320
1321
1322
1323
1324
1325
1326
1327 <hr />
1328
1329 <a name="isZoomed"> </a>
1330 <div class="fixedFont">
1331
1332
1333 <b>isZoomed</b>(axis)
1334
1335 </div>
1336 <div class="description">
1337 Returns the zoomed status of the chart for one or both axes.
1338
1339 Axis is an optional parameter. Can be set to 'x' or 'y'.
1340
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).
1344
1345
1346 </div>
1347
1348
1349
1350
1351 <dl class="detailList">
1352 <dt class="heading">Parameters:</dt>
1353
1354 <dt>
1355 <b>axis</b>
1356
1357 </dt>
1358 <dd></dd>
1359
1360 </dl>
1361
1362
1363
1364
1365
1366
1367
1368
1369 <hr />
1370
1371 <a name=".movePan"> </a>
1372 <div class="fixedFont">&lt;static&gt;
1373
1374
1375 <span class="light">Dygraph.</span><b>movePan</b>(event, g, context)
1376
1377 </div>
1378 <div class="description">
1379 Called in response to an interaction model operation that
1380 responds to an event that pans the view.
1381
1382 It's used in the default callback for "mousemove" operations.
1383 Custom interaction model builders can use it to provide the default
1384 panning behavior.
1385
1386
1387 </div>
1388
1389
1390
1391
1392 <dl class="detailList">
1393 <dt class="heading">Parameters:</dt>
1394
1395 <dt>
1396 <span class="light fixedFont">{Event}</span> <b>event</b>
1397
1398 </dt>
1399 <dd>the event object which led to the movePan call.</dd>
1400
1401 <dt>
1402 <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
1403
1404 </dt>
1405 <dd>The dygraph on which to act.</dd>
1406
1407 <dt>
1408 <span class="light fixedFont">{Object}</span> <b>context</b>
1409
1410 </dt>
1411 <dd>The dragging context object (with
1412 dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
1413
1414 </dl>
1415
1416
1417
1418
1419
1420
1421
1422
1423 <hr />
1424
1425 <a name=".moveZoom"> </a>
1426 <div class="fixedFont">&lt;static&gt;
1427
1428
1429 <span class="light">Dygraph.</span><b>moveZoom</b>(event, g, context)
1430
1431 </div>
1432 <div class="description">
1433 Called in response to an interaction model operation that
1434 responds to an event that defines zoom boundaries.
1435
1436 It's used in the default callback for "mousemove" operations.
1437 Custom interaction model builders can use it to provide the default
1438 zooming behavior.
1439
1440
1441 </div>
1442
1443
1444
1445
1446 <dl class="detailList">
1447 <dt class="heading">Parameters:</dt>
1448
1449 <dt>
1450 <span class="light fixedFont">{Event}</span> <b>event</b>
1451
1452 </dt>
1453 <dd>the event object which led to the moveZoom call.</dd>
1454
1455 <dt>
1456 <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
1457
1458 </dt>
1459 <dd>The dygraph on which to act.</dd>
1460
1461 <dt>
1462 <span class="light fixedFont">{Object}</span> <b>context</b>
1463
1464 </dt>
1465 <dd>The dragging context object (with
1466 dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
1467
1468 </dl>
1469
1470
1471
1472
1473
1474
1475
1476
1477 <hr />
1478
1479 <a name="numAxes"> </a>
1480 <div class="fixedFont">
1481
1482 <span class="light">{Number}</span>
1483 <b>numAxes</b>()
1484
1485 </div>
1486 <div class="description">
1487 Returns the number of y-axes on the chart.
1488
1489
1490 </div>
1491
1492
1493
1494
1495
1496
1497
1498
1499 <dl class="detailList">
1500 <dt class="heading">Returns:</dt>
1501
1502 <dd><span class="light fixedFont">{Number}</span> the number of axes.</dd>
1503
1504 </dl>
1505
1506
1507
1508
1509 <hr />
1510
1511 <a name="numColumns"> </a>
1512 <div class="fixedFont">
1513
1514 <span class="light">{Integer}</span>
1515 <b>numColumns</b>()
1516
1517 </div>
1518 <div class="description">
1519 Returns the number of columns (including the independent variable).
1520
1521
1522 </div>
1523
1524
1525
1526
1527
1528
1529
1530
1531 <dl class="detailList">
1532 <dt class="heading">Returns:</dt>
1533
1534 <dd><span class="light fixedFont">{Integer}</span> The number of columns.</dd>
1535
1536 </dl>
1537
1538
1539
1540
1541 <hr />
1542
1543 <a name=".numericTicks"> </a>
1544 <div class="fixedFont">&lt;static&gt;
1545
1546 <span class="light">{[Object]}</span>
1547 <span class="light">Dygraph.</span><b>numericTicks</b>(minV, maxV, self, attribute, vals)
1548
1549 </div>
1550 <div class="description">
1551 Add ticks when the x axis has numbers on it (instead of dates)
1552
1553
1554 </div>
1555
1556
1557
1558
1559 <dl class="detailList">
1560 <dt class="heading">Parameters:</dt>
1561
1562 <dt>
1563 <span class="light fixedFont">{Number}</span> <b>minV</b>
1564
1565 </dt>
1566 <dd>minimum value</dd>
1567
1568 <dt>
1569 <span class="light fixedFont">{Number}</span> <b>maxV</b>
1570
1571 </dt>
1572 <dd>maximum value</dd>
1573
1574 <dt>
1575 <b>self</b>
1576
1577 </dt>
1578 <dd></dd>
1579
1580 <dt>
1581 <span class="light fixedFont">{function}</span> <b>attribute</b>
1582
1583 </dt>
1584 <dd>accessor function.</dd>
1585
1586 <dt>
1587 <b>vals</b>
1588
1589 </dt>
1590 <dd></dd>
1591
1592 </dl>
1593
1594
1595
1596
1597
1598 <dl class="detailList">
1599 <dt class="heading">Returns:</dt>
1600
1601 <dd><span class="light fixedFont">{[Object]}</span> Array of {label, value} tuples.</dd>
1602
1603 </dl>
1604
1605
1606
1607
1608 <hr />
1609
1610 <a name="numRows"> </a>
1611 <div class="fixedFont">
1612
1613 <span class="light">{Integer}</span>
1614 <b>numRows</b>()
1615
1616 </div>
1617 <div class="description">
1618 Returns the number of rows (excluding any header/label row).
1619
1620
1621 </div>
1622
1623
1624
1625
1626
1627
1628
1629
1630 <dl class="detailList">
1631 <dt class="heading">Returns:</dt>
1632
1633 <dd><span class="light fixedFont">{Integer}</span> The number of rows, less any header.</dd>
1634
1635 </dl>
1636
1637
1638
1639
1640 <hr />
1641
1642 <a name="resize"> </a>
1643 <div class="fixedFont">
1644
1645
1646 <b>resize</b>(width, height)
1647
1648 </div>
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.
1653
1654 This is far more efficient than destroying and re-instantiating a
1655 Dygraph, since it doesn't have to reparse the underlying data.
1656
1657
1658 </div>
1659
1660
1661
1662
1663 <dl class="detailList">
1664 <dt class="heading">Parameters:</dt>
1665
1666 <dt>
1667 <span class="light fixedFont">{Number}</span> <b>width</b>
1668 <i>Optional</i>
1669 </dt>
1670 <dd>Width (in pixels)</dd>
1671
1672 <dt>
1673 <span class="light fixedFont">{Number}</span> <b>height</b>
1674 <i>Optional</i>
1675 </dt>
1676 <dd>Height (in pixels)</dd>
1677
1678 </dl>
1679
1680
1681
1682
1683
1684
1685
1686
1687 <hr />
1688
1689 <a name="rollPeriod"> </a>
1690 <div class="fixedFont">
1691
1692 <span class="light">{Number}</span>
1693 <b>rollPeriod</b>()
1694
1695 </div>
1696 <div class="description">
1697 Returns the current rolling period, as set by the user or an option.
1698
1699
1700 </div>
1701
1702
1703
1704
1705
1706
1707
1708
1709 <dl class="detailList">
1710 <dt class="heading">Returns:</dt>
1711
1712 <dd><span class="light fixedFont">{Number}</span> The number of points in the rolling window</dd>
1713
1714 </dl>
1715
1716
1717
1718
1719 <hr />
1720
1721 <a name="setAnnotations"> </a>
1722 <div class="fixedFont">
1723
1724
1725 <b>setAnnotations</b>(ann, suppressDraw)
1726
1727 </div>
1728 <div class="description">
1729 Update the list of annotations and redraw the chart.
1730
1731
1732 </div>
1733
1734
1735
1736
1737 <dl class="detailList">
1738 <dt class="heading">Parameters:</dt>
1739
1740 <dt>
1741 <b>ann</b>
1742
1743 </dt>
1744 <dd></dd>
1745
1746 <dt>
1747 <b>suppressDraw</b>
1748
1749 </dt>
1750 <dd></dd>
1751
1752 </dl>
1753
1754
1755
1756
1757
1758
1759
1760
1761 <hr />
1762
1763 <a name="setSelection"> </a>
1764 <div class="fixedFont">
1765
1766
1767 <b>setSelection</b>(row)
1768
1769 </div>
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().
1774
1775
1776 </div>
1777
1778
1779
1780
1781 <dl class="detailList">
1782 <dt class="heading">Parameters:</dt>
1783
1784 <dt>
1785 <span class="light fixedFont">{Integer}</span> <b>row</b>
1786
1787 </dt>
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>
1790
1791 </dl>
1792
1793
1794
1795
1796
1797
1798
1799
1800 <hr />
1801
1802 <a name="setVisibility"> </a>
1803 <div class="fixedFont">
1804
1805
1806 <b>setVisibility</b>(num, value)
1807
1808 </div>
1809 <div class="description">
1810 Changes the visiblity of a series.
1811
1812
1813 </div>
1814
1815
1816
1817
1818 <dl class="detailList">
1819 <dt class="heading">Parameters:</dt>
1820
1821 <dt>
1822 <b>num</b>
1823
1824 </dt>
1825 <dd></dd>
1826
1827 <dt>
1828 <b>value</b>
1829
1830 </dt>
1831 <dd></dd>
1832
1833 </dl>
1834
1835
1836
1837
1838
1839
1840
1841
1842 <hr />
1843
1844 <a name=".startPan"> </a>
1845 <div class="fixedFont">&lt;static&gt;
1846
1847
1848 <span class="light">Dygraph.</span><b>startPan</b>(event, g, context)
1849
1850 </div>
1851 <div class="description">
1852 Called in response to an interaction model operation that
1853 should start the default panning behavior.
1854
1855 It's used in the default callback for "mousedown" operations.
1856 Custom interaction model builders can use it to provide the default
1857 panning behavior.
1858
1859
1860 </div>
1861
1862
1863
1864
1865 <dl class="detailList">
1866 <dt class="heading">Parameters:</dt>
1867
1868 <dt>
1869 <span class="light fixedFont">{Event}</span> <b>event</b>
1870
1871 </dt>
1872 <dd>the event object which led to the startPan call.</dd>
1873
1874 <dt>
1875 <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
1876
1877 </dt>
1878 <dd>The dygraph on which to act.</dd>
1879
1880 <dt>
1881 <span class="light fixedFont">{Object}</span> <b>context</b>
1882
1883 </dt>
1884 <dd>The dragging context object (with
1885 dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
1886
1887 </dl>
1888
1889
1890
1891
1892
1893
1894
1895
1896 <hr />
1897
1898 <a name=".startZoom"> </a>
1899 <div class="fixedFont">&lt;static&gt;
1900
1901
1902 <span class="light">Dygraph.</span><b>startZoom</b>(event, g, context)
1903
1904 </div>
1905 <div class="description">
1906 Called in response to an interaction model operation that
1907 responds to an event that starts zooming.
1908
1909 It's used in the default callback for "mousedown" operations.
1910 Custom interaction model builders can use it to provide the default
1911 zooming behavior.
1912
1913
1914 </div>
1915
1916
1917
1918
1919 <dl class="detailList">
1920 <dt class="heading">Parameters:</dt>
1921
1922 <dt>
1923 <span class="light fixedFont">{Event}</span> <b>event</b>
1924
1925 </dt>
1926 <dd>the event object which led to the startZoom call.</dd>
1927
1928 <dt>
1929 <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
1930
1931 </dt>
1932 <dd>The dygraph on which to act.</dd>
1933
1934 <dt>
1935 <span class="light fixedFont">{Object}</span> <b>context</b>
1936
1937 </dt>
1938 <dd>The dragging context object (with
1939 dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
1940
1941 </dl>
1942
1943
1944
1945
1946
1947
1948
1949
1950 <hr />
1951
1952 <a name="toDataCoords"> </a>
1953 <div class="fixedFont">
1954
1955
1956 <b>toDataCoords</b>(x, y, axis)
1957
1958 </div>
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].
1964
1965 Note: use toDataXCoord instead of toDataCoords(x, null) and use toDataYCoord
1966 instead of toDataCoords(null, y, axis).
1967
1968
1969 </div>
1970
1971
1972
1973
1974 <dl class="detailList">
1975 <dt class="heading">Parameters:</dt>
1976
1977 <dt>
1978 <b>x</b>
1979
1980 </dt>
1981 <dd></dd>
1982
1983 <dt>
1984 <b>y</b>
1985
1986 </dt>
1987 <dd></dd>
1988
1989 <dt>
1990 <b>axis</b>
1991
1992 </dt>
1993 <dd></dd>
1994
1995 </dl>
1996
1997
1998
1999
2000
2001
2002
2003
2004 <hr />
2005
2006 <a name="toDataXCoord"> </a>
2007 <div class="fixedFont">
2008
2009
2010 <b>toDataXCoord</b>(x)
2011
2012 </div>
2013 <div class="description">
2014 Convert from canvas/div x coordinate to data coordinate.
2015
2016 If x is null, this returns null.
2017
2018
2019 </div>
2020
2021
2022
2023
2024 <dl class="detailList">
2025 <dt class="heading">Parameters:</dt>
2026
2027 <dt>
2028 <b>x</b>
2029
2030 </dt>
2031 <dd></dd>
2032
2033 </dl>
2034
2035
2036
2037
2038
2039
2040
2041
2042 <hr />
2043
2044 <a name="toDataYCoord"> </a>
2045 <div class="fixedFont">
2046
2047
2048 <b>toDataYCoord</b>(y, axis)
2049
2050 </div>
2051 <div class="description">
2052 Convert from canvas/div y coord to value.
2053
2054 If y is null, this returns null.
2055 if axis is null, this uses the first axis.
2056
2057
2058 </div>
2059
2060
2061
2062
2063 <dl class="detailList">
2064 <dt class="heading">Parameters:</dt>
2065
2066 <dt>
2067 <b>y</b>
2068
2069 </dt>
2070 <dd></dd>
2071
2072 <dt>
2073 <b>axis</b>
2074
2075 </dt>
2076 <dd></dd>
2077
2078 </dl>
2079
2080
2081
2082
2083
2084
2085
2086
2087 <hr />
2088
2089 <a name="toDomCoords"> </a>
2090 <div class="fixedFont">
2091
2092
2093 <b>toDomCoords</b>(x, y, axis)
2094
2095 </div>
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]
2101
2102 Note: use toDomXCoord instead of toDomCoords(x, null) and use toDomYCoord
2103 instead of toDomCoords(null, y, axis).
2104
2105
2106 </div>
2107
2108
2109
2110
2111 <dl class="detailList">
2112 <dt class="heading">Parameters:</dt>
2113
2114 <dt>
2115 <b>x</b>
2116
2117 </dt>
2118 <dd></dd>
2119
2120 <dt>
2121 <b>y</b>
2122
2123 </dt>
2124 <dd></dd>
2125
2126 <dt>
2127 <b>axis</b>
2128
2129 </dt>
2130 <dd></dd>
2131
2132 </dl>
2133
2134
2135
2136
2137
2138
2139
2140
2141 <hr />
2142
2143 <a name="toDomXCoord"> </a>
2144 <div class="fixedFont">
2145
2146
2147 <b>toDomXCoord</b>(x)
2148
2149 </div>
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
2153 axis.
2154 Returns a single value or null if x is null.
2155
2156
2157 </div>
2158
2159
2160
2161
2162 <dl class="detailList">
2163 <dt class="heading">Parameters:</dt>
2164
2165 <dt>
2166 <b>x</b>
2167
2168 </dt>
2169 <dd></dd>
2170
2171 </dl>
2172
2173
2174
2175
2176
2177
2178
2179
2180 <hr />
2181
2182 <a name="toDomYCoord"> </a>
2183 <div class="fixedFont">
2184
2185
2186 <b>toDomYCoord</b>(y, axis)
2187
2188 </div>
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.
2192
2193 returns a single value or null if y is null.
2194
2195
2196 </div>
2197
2198
2199
2200
2201 <dl class="detailList">
2202 <dt class="heading">Parameters:</dt>
2203
2204 <dt>
2205 <b>y</b>
2206
2207 </dt>
2208 <dd></dd>
2209
2210 <dt>
2211 <b>axis</b>
2212
2213 </dt>
2214 <dd></dd>
2215
2216 </dl>
2217
2218
2219
2220
2221
2222
2223
2224
2225 <hr />
2226
2227 <a name="toPercentXCoord"> </a>
2228 <div class="fixedFont">
2229
2230 <span class="light">{Number}</span>
2231 <b>toPercentXCoord</b>(x)
2232
2233 </div>
2234 <div class="description">
2235 Converts an x value to a percentage from the left to the right of
2236 the drawing area.
2237
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.
2242
2243 If x is null, this returns null.
2244
2245
2246 </div>
2247
2248
2249
2250
2251 <dl class="detailList">
2252 <dt class="heading">Parameters:</dt>
2253
2254 <dt>
2255 <span class="light fixedFont">{Number}</span> <b>x</b>
2256
2257 </dt>
2258 <dd>The data x-coordinate.</dd>
2259
2260 </dl>
2261
2262
2263
2264
2265
2266 <dl class="detailList">
2267 <dt class="heading">Returns:</dt>
2268
2269 <dd><span class="light fixedFont">{Number}</span> A fraction in [0, 1] where 0 = the left edge.</dd>
2270
2271 </dl>
2272
2273
2274
2275
2276 <hr />
2277
2278 <a name="toPercentYCoord"> </a>
2279 <div class="fixedFont">
2280
2281 <span class="light">{Number}</span>
2282 <b>toPercentYCoord</b>(y, axis)
2283
2284 </div>
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.
2288
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.
2293
2294 If y is null, this returns null.
2295 if axis is null, this uses the first axis.
2296
2297
2298 </div>
2299
2300
2301
2302
2303 <dl class="detailList">
2304 <dt class="heading">Parameters:</dt>
2305
2306 <dt>
2307 <span class="light fixedFont">{Number}</span> <b>y</b>
2308
2309 </dt>
2310 <dd>The data y-coordinate.</dd>
2311
2312 <dt>
2313 <span class="light fixedFont">{Number}</span> <b>axis</b>
2314 <i>Optional</i>
2315 </dt>
2316 <dd>The axis number on which the data coordinate lives.</dd>
2317
2318 </dl>
2319
2320
2321
2322
2323
2324 <dl class="detailList">
2325 <dt class="heading">Returns:</dt>
2326
2327 <dd><span class="light fixedFont">{Number}</span> A fraction in [0, 1] where 0 = the top edge.</dd>
2328
2329 </dl>
2330
2331
2332
2333
2334 <hr />
2335
2336 <a name="toString"> </a>
2337 <div class="fixedFont">
2338
2339
2340 <b>toString</b>()
2341
2342 </div>
2343 <div class="description">
2344 Returns information about the Dygraph object, including its containing ID.
2345
2346
2347 </div>
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359 <hr />
2360
2361 <a name=".toString"> </a>
2362 <div class="fixedFont">&lt;static&gt;
2363
2364
2365 <span class="light">Dygraph.</span><b>toString</b>()
2366
2367 </div>
2368 <div class="description">
2369 Returns information about the Dygraph class.
2370
2371
2372 </div>
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384 <hr />
2385
2386 <a name="updateOptions"> </a>
2387 <div class="fixedFont">
2388
2389
2390 <b>updateOptions</b>(attrs)
2391
2392 </div>
2393 <div class="description">
2394 Changes various properties of the graph. These can include:
2395 <ul>
2396 <li>file: changes the source data for the graph</li>
2397 <li>errorBars: changes whether the data contains stddev</li>
2398 </ul>
2399
2400
2401 </div>
2402
2403
2404
2405
2406 <dl class="detailList">
2407 <dt class="heading">Parameters:</dt>
2408
2409 <dt>
2410 <span class="light fixedFont">{Object}</span> <b>attrs</b>
2411
2412 </dt>
2413 <dd>The new properties and values</dd>
2414
2415 </dl>
2416
2417
2418
2419
2420
2421
2422
2423
2424 <hr />
2425
2426 <a name="visibility"> </a>
2427 <div class="fixedFont">
2428
2429
2430 <b>visibility</b>()
2431
2432 </div>
2433 <div class="description">
2434 Returns a boolean array of visibility statuses.
2435
2436
2437 </div>
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449 <hr />
2450
2451 <a name="xAxisExtremes"> </a>
2452 <div class="fixedFont">
2453
2454
2455 <b>xAxisExtremes</b>()
2456
2457 </div>
2458 <div class="description">
2459 Returns the lower- and upper-bound x-axis values of the
2460 data set.
2461
2462
2463 </div>
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475 <hr />
2476
2477 <a name="xAxisRange"> </a>
2478 <div class="fixedFont">
2479
2480
2481 <b>xAxisRange</b>()
2482
2483 </div>
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.
2489
2490
2491 </div>
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503 <hr />
2504
2505 <a name="yAxisRange"> </a>
2506 <div class="fixedFont">
2507
2508
2509 <b>yAxisRange</b>(idx)
2510
2511 </div>
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].
2517
2518
2519 </div>
2520
2521
2522
2523
2524 <dl class="detailList">
2525 <dt class="heading">Parameters:</dt>
2526
2527 <dt>
2528 <b>idx</b>
2529
2530 </dt>
2531 <dd></dd>
2532
2533 </dl>
2534
2535
2536
2537
2538
2539
2540
2541
2542 <hr />
2543
2544 <a name="yAxisRanges"> </a>
2545 <div class="fixedFont">
2546
2547
2548 <b>yAxisRanges</b>()
2549
2550 </div>
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.
2555
2556
2557 </div>
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573 <!-- ============================== event details ========================= -->
2574
2575
2576 <hr />
2577 </div>
2578
2579
2580 <!-- ============================== footer ================================= -->
2581 <div class="fineprint" style="clear:both">
2582
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)
2584 </div>
2585 </body>
2586 </html>