X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-canvas.js;h=165d885f86636ff38b67c34801f2387fd028882e;hb=bc3e2c5dd0baa4fae1624da1cb4ea39496a20319;hp=571191c399969825e272f4bb0c42f1ad3cd973e7;hpb=42a9ebb8f492d2541a3904894447a7c74ba4cfd5;p=dygraphs.git diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 571191c..165d885 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -618,7 +618,7 @@ DygraphCanvasRenderer._errorPlotter = function(e) { ctx.beginPath(); while (iter.hasNext) { var point = iter.next(); - if (!Dygraph.isOK(point.y)) { + if ((!stepPlot && !Dygraph.isOK(point.y)) || (stepPlot && !isNaN(prevY) && !Dygraph.isOK(prevY))) { prevX = NaN; continue; } @@ -633,17 +633,15 @@ DygraphCanvasRenderer._errorPlotter = function(e) { newYs[1] = e.plotArea.h * newYs[1] + e.plotArea.y; if (!isNaN(prevX)) { if (stepPlot) { - ctx.moveTo(prevX, newYs[0]); - } else { ctx.moveTo(prevX, prevYs[0]); - } - ctx.lineTo(point.canvasx, newYs[0]); - ctx.lineTo(point.canvasx, newYs[1]); - if (stepPlot) { - ctx.lineTo(prevX, newYs[1]); + ctx.lineTo(point.canvasx, prevYs[0]); + ctx.lineTo(point.canvasx, prevYs[1]); } else { - ctx.lineTo(prevX, prevYs[1]); + ctx.moveTo(prevX, prevYs[0]); + ctx.lineTo(point.canvasx, newYs[0]); + ctx.lineTo(point.canvasx, newYs[1]); } + ctx.lineTo(prevX, prevYs[1]); ctx.closePath(); } prevYs = newYs;