X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-canvas.js;h=e5939d0a13f220e4b4012f521267c1f6ec3a7cab;hb=41273327c7eb2aaa777194f48516e69784aef7f1;hp=ff291e5db633874c829342faca327855505a1a48;hpb=52faf8b75dc38edc022f2c725d25dad9c66fba8c;p=dygraphs.git diff --git a/dygraph-canvas.js b/dygraph-canvas.js index ff291e5..e5939d0 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -692,6 +692,7 @@ DygraphCanvasRenderer.prototype._drawStyledLine = function( if (!Dygraph.isArrayLike(strokePattern)) { strokePattern = null; } + var drawGapPoints = this.dygraph_.attr_('drawGapPoints', setName); var point; var next = DygraphCanvasRenderer.makeNextPointStep_( @@ -715,6 +716,14 @@ DygraphCanvasRenderer.prototype._drawStyledLine = function( // 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; + } + } if (prevX === null) { prevX = point.canvasx; prevY = point.canvasy;