2 * @fileoverview Utility functions for Dygraphs.
4 * @author konigsberg@google.com (Robert Konigsberg)
9 * Get the y-labels for a given axis. You can specify a parent if more than one
10 * graph is on the document.
12 Util
.getYLabels
= function(axis_num
, parent
) {
13 axis_num
= axis_num
|| "";
14 parent
= parent
|| document
;
15 var y_labels
= parent
.getElementsByClassName("dygraph-axis-label-y" + axis_num
);
17 for (var i
= 0; i
< y_labels
.length
; i
++) {
18 ary
.push(y_labels
[i
].innerHTML
);
24 * Returns all text in tags w/ a given css class, sorted.
25 * You can specify a parent if more than one graph is on the document.
27 Util
.getClassTexts
= function(css_class
, parent
) {
28 parent
= parent
|| document
;
30 var els
= parent
.getElementsByClassName(css_class
);
31 for (var i
= 0; i
< els
.length
; i
++) {
32 texts
[i
] = els
[i
].textContent
;