Fix problems with multiple null values in a row for stepped graphs.
authorNeal Nelson <neal@makalumedia.com>
Thu, 17 Jun 2010 14:22:29 +0000 (16:22 +0200)
committerNeal Nelson <neal@makalumedia.com>
Thu, 17 Jun 2010 14:22:29 +0000 (16:22 +0200)
dygraph-canvas.js
tests/steps.html

index 3988b19..d5c812e 100644 (file)
@@ -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;
index 81dfbd0..8d77989 100644 (file)
@@ -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",
         [ 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]