bindEvt('clickHandler', 'annotationClickHandler', p, this));
bindEvt('clickHandler', 'annotationClickHandler', p, this));
bindEvt('mouseOverHandler', 'annotationMouseOverHandler', p, this));
bindEvt('mouseOverHandler', 'annotationMouseOverHandler', p, this));
bindEvt('mouseOutHandler', 'annotationMouseOutHandler', p, this));
bindEvt('mouseOutHandler', 'annotationMouseOutHandler', p, this));
bindEvt('dblClickHandler', 'annotationDblClickHandler', p, this));
this.container.appendChild(div);
bindEvt('dblClickHandler', 'annotationDblClickHandler', p, this));
this.container.appendChild(div);
DygraphCanvasRenderer.prototype._drawStyledLine = function(
ctx, i, setName, color, strokeWidth, strokePattern, drawPoints,
drawPointCallback, pointSize) {
DygraphCanvasRenderer.prototype._drawStyledLine = function(
ctx, i, setName, color, strokeWidth, strokePattern, drawPoints,
drawPointCallback, pointSize) {
// and next points are null.
var isIsolated = (!prevX && (j == points.length - 1 ||
isNullOrNaN(points[j+1].canvasy)));
// and next points are null.
var isIsolated = (!prevX && (j == points.length - 1 ||
isNullOrNaN(points[j+1].canvasy)));
+ if (drawGapPoints) {
+ // Also consider a point to be is "isolated" if it's adjacent to a
+ // null point, excluding the graph edges.
+ if ((j > 0 && !prevX) ||
+ (j < points.length - 1 && isNullOrNaN(points[j+1].canvasy))) {
+ isIsolated = true;
+ }
+ }
this.dygraph_, setName, ctx, cb[0], cb[1], color, pointSize);
ctx.restore();
}
this.dygraph_, setName, ctx, cb[0], cb[1], color, pointSize);
ctx.restore();
}
+ var firstIndexInSet = this.layout.setPointsOffsets[i];
+ var setLength = this.layout.setPointsLengths[i];
+ var afterLastIndexInSet = firstIndexInSet + setLength;
+
+ var next = DygraphCanvasRenderer.makeNextPointStep_(
+ this.attr_('connectSeparatedPoints'), points,
+ afterLastIndexInSet);
+
if (axisY < 0.0) axisY = 0.0;
else if (axisY > 1.0) axisY = 1.0;
axisY = this.area.h * axisY + this.area.y;
if (axisY < 0.0) axisY = 0.0;
else if (axisY > 1.0) axisY = 1.0;
axisY = this.area.h * axisY + this.area.y;
+ var firstIndexInSet = this.layout.setPointsOffsets[i];
+ var setLength = this.layout.setPointsLengths[i];
+ var afterLastIndexInSet = firstIndexInSet + setLength;
+
+ var next = DygraphCanvasRenderer.makeNextPointStep_(
+ this.attr_('connectSeparatedPoints'), points,
+ afterLastIndexInSet);
- var lastY = baseline[point.canvasx];
- if (lastY === undefined) lastY = axisY;
- baseline[point.canvasx] = point.canvasy;
+ currBaseline = baseline[point.canvasx];
+ var lastY;
+ if (currBaseline === undefined) {
+ lastY = axisY;
+ } else {
+ if(stepPlot) {
+ lastY = currBaseline[0];
+ } else {
+ lastY = currBaseline;
+ }
+ }
+
+ if(stepPlot) {
+ // Step plots must keep track of the top and bottom of
+ // the baseline at each point.
+ if(prevYs[0] === -1) {
+ baseline[point.canvasx] = [ point.canvasy, axisY ];
+ } else {
+ baseline[point.canvasx] = [ point.canvasy, prevYs[0] ];
+ }
+ } else {
+ baseline[point.canvasx] = point.canvasy;
+ }
+
} else {
newYs = [ point.canvasy, axisY ];
}
if (!isNaN(prevX)) {
ctx.moveTo(prevX, prevYs[0]);
} else {
newYs = [ point.canvasy, axisY ];
}
if (!isNaN(prevX)) {
ctx.moveTo(prevX, prevYs[0]);