From 0599d13b7ddc7b0820ce6bac78085335ec14522e Mon Sep 17 00:00:00 2001 From: Neal Nelson Date: Thu, 17 Jun 2010 16:07:52 +0200 Subject: [PATCH] Ensure step plots draw lines to the start of missing values. --- dygraph-canvas.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 2eb5ce1..3988b19 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -616,6 +616,15 @@ DygraphCanvasRenderer.prototype._renderLineChart = function() { var point = points[j]; if (point.name == setName) { if (!isOK(point.canvasy)) { + if (stepPlot) { + // Draw a horizontal line to the start of the missing data + ctx.beginPath(); + ctx.strokeStyle = color; + ctx.lineWidth = this.options.strokeWidth; + ctx.moveTo(prevX, prevY); + ctx.lineTo(point.canvasx, prevY); + ctx.stroke(); + } // this will make us move to the next point, not draw a line to it. prevX = prevY = null; } else { -- 2.7.4