var y_labels = parent.getElementsByClassName("dygraph-axis-label-y" + axis_num);
var ary = [];
for (var i = 0; i < y_labels.length; i++) {
- ary.push(y_labels[i].innerHTML.replace(/ /g, ' '));
+ ary.push(y_labels[i].innerHTML.replace(/ | /g, ' '));
}
return ary;
};
var x_labels = parent.getElementsByClassName("dygraph-axis-label-x");
var ary = [];
for (var i = 0; i < x_labels.length; i++) {
- ary.push(x_labels[i].innerHTML.replace(/ /g, ' '));
+ ary.push(x_labels[i].innerHTML.replace(/ | /g, ' '));
}
return ary;
};
};
};
-// Change ' ' to ' ' in all labels. Cleans up expected values.
+// Change ' ' (non-breaking space) to ' ' in all labels. Cleans up expected values.
function changeNbspToSpace(ticks) {
for (var i = 0; i < ticks.length; i++) {
if (ticks[i].label) {
- ticks[i].label = ticks[i].label.replace(/ /g, ' ');
+ ticks[i].label = ticks[i].label.replace(/ /g, ' ');
}
}
}
if (granularity >= Dygraph.DECADAL) {
return '' + year;
} else if (granularity >= Dygraph.MONTHLY) {
- return Dygraph.SHORT_MONTH_NAMES_[month] + ' ' + year;
+ return Dygraph.SHORT_MONTH_NAMES_[month] + ' ' + year;
} else {
var frac = hours * 3600 + mins * 60 + secs + 1e-3 * millis;
if (frac === 0 || granularity >= Dygraph.DAILY) {
// e.g. '21 Jan' (%d%b)
- return Dygraph.zeropad(day) + ' ' + Dygraph.SHORT_MONTH_NAMES_[month];
+ return Dygraph.zeropad(day) + ' ' + Dygraph.SHORT_MONTH_NAMES_[month];
} else {
return Dygraph.hmsString_(hours, mins, secs);
}