// 2. e.relatedTarget is outside the chart
var target = e.target || e.fromElement;
var relatedTarget = e.relatedTarget || e.toElement;
- if (Dygraph.isElementContainedBy(target, dygraph.graphDiv) &&
- !Dygraph.isElementContainedBy(relatedTarget, dygraph.graphDiv)) {
+ if (Dygraph.isNodeContainedBy(target, dygraph.graphDiv) &&
+ !Dygraph.isNodeContainedBy(relatedTarget, dygraph.graphDiv)) {
dygraph.mouseOut_(e);
}
};
ctx.strokeStyle = color;
ctx.fillStyle = color;
callback(this.g, pt.name, ctx, canvasx, pt.canvasy,
- color, circleSize);
+ color, circleSize, pt.idx);
}
ctx.restore();
series[j][1][2]];
}
} else if (this.attr_("stackedGraph")) {
- var actual_y, last_x;
+ // Need to clear last_x explicitly as javascript's locals are
+ // local to function, not to a block of statements
+ var actual_y, last_x = null;
for (j = 0; j < series.length; j++) {
// If one data set has a NaN, let all subsequent stacked
// sets inherit the NaN -- only start at 0 for the first set.
continue;
}
- if (j === 0 || last_x != x) {
+ if (last_x != x) {
cumulative_y[x] += actual_y;
// If an x-value is repeated, we ignore the duplicates.
}