var canvasx = Dygraph.pageX(event) - Dygraph.findPosX(this.mouseEventElement_);
var points = this.layout_.points;
+ // This prevents JS errors when mousing over the canvas before data loads.
+ if (points === 'undefined') return;
+
var lastx = -1;
var lasty = -1;
var ticks = [];
if (vals) {
for (var i = 0; i < vals.length; i++) {
- ticks[i].push({v: vals[i]});
+ ticks.push({v: vals[i]});
}
} else {
if (axis_props && attr("logscale")) {
// Add labels to the ticks.
for (var i = 0; i < ticks.length; i++) {
+ if (ticks[i].label !== undefined) continue; // Use current label.
var tickV = ticks[i].v;
var absTickV = Math.abs(tickV);
var label = (formatter !== undefined) ?
// On the log scale, points less than zero do not exist.
// This will create a gap in the chart. Note that this ignores
// connectSeparatedPoints.
- if (point < 0) {
+ if (point <= 0) {
point = null;
}
series.push([date, point]);