X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-canvas.js;h=6e503d92494b0d1d5a22d28e597fcf4e48d932ef;hb=refs%2Fheads%2Fissue-485-sep-fill;hp=4d7a7dd7de1379d444b915fc9ac2f6f7f043609f;hpb=c17e11738cb5603fafcdc84527114502312344c4;p=dygraphs.git diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 4d7a7dd..6e503d9 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -599,12 +599,16 @@ DygraphCanvasRenderer._errorPlotter = function(e) { continue; } + newYs = [ point.y_bottom, point.y_top ]; if (stepPlot) { - newYs = [ point.y_bottom, point.y_top ]; prevY = point.y; - } else { - newYs = [ point.y_bottom, point.y_top ]; } + + // The documentation specifically disallows nulls inside the point arrays, + // but in case it happens we should do something sensible. + if (isNaN(newYs[0])) newYs[0] = point.y; + if (isNaN(newYs[1])) newYs[1] = point.y; + newYs[0] = e.plotArea.h * newYs[0] + e.plotArea.y; newYs[1] = e.plotArea.h * newYs[1] + e.plotArea.y; if (!isNaN(prevX)) {