From 5d13ef68a27544eff72ea3a2ef3aabdc4c4fd740 Mon Sep 17 00:00:00 2001 From: Neal Nelson Date: Thu, 17 Jun 2010 16:22:29 +0200 Subject: [PATCH] Fix problems with multiple null values in a row for stepped graphs. --- dygraph-canvas.js | 2 +- tests/steps.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 3988b19..d5c812e 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -616,7 +616,7 @@ DygraphCanvasRenderer.prototype._renderLineChart = function() { var point = points[j]; if (point.name == setName) { if (!isOK(point.canvasy)) { - if (stepPlot) { + if (stepPlot && prevX != null) { // Draw a horizontal line to the start of the missing data ctx.beginPath(); ctx.strokeStyle = color; diff --git a/tests/steps.html b/tests/steps.html index 81dfbd0..8d77989 100644 --- a/tests/steps.html +++ b/tests/steps.html @@ -99,7 +99,7 @@ "2009/12/01,10,10\n" + "2009/12/02,15,11\n" + "2009/12/03,,12\n" + - "2009/12/04,20,13\n" + + "2009/12/04,,13\n" + "2009/12/05,15,\n" + "2009/12/06,18,15\n" + "2009/12/07,12,16\n", @@ -118,7 +118,7 @@ [ new Date("2009/12/01"), 10, 10], [ new Date("2009/12/02"), 15, 11], [ new Date("2009/12/03"), null, 12], - [ new Date("2009/12/04"), 20, 13], + [ new Date("2009/12/04"), null, 13], [ new Date("2009/12/05"), 15, null], [ new Date("2009/12/06"), 18, 15], [ new Date("2009/12/07"), 12, 16] -- 2.7.4