remove another if
authorDan Vanderkam <dan@dygraphs.com>
Tue, 17 Jul 2012 17:12:44 +0000 (12:12 -0500)
committerDan Vanderkam <dan@dygraphs.com>
Tue, 17 Jul 2012 17:12:44 +0000 (12:12 -0500)
dygraph-canvas.js

index efae1cf..3d4b880 100644 (file)
@@ -470,39 +470,37 @@ DygraphCanvasRenderer.prototype.drawErrorBars_ = function(points) {
     ctx.beginPath();
     while (iter.hasNext) {
       var point = iter.next();
-      if (point.name == setName) { // TODO(klausw): this is always true
-        if (!Dygraph.isOK(point.y)) {
-          prevX = NaN;
-          continue;
-        }
+      if (!Dygraph.isOK(point.y)) {
+        prevX = NaN;
+        continue;
+      }
 
-        // TODO(danvk): here
+      // TODO(danvk): here
+      if (stepPlot) {
+        newYs = [ point.y_bottom, point.y_top ];
+        prevY = point.y;
+      } else {
+        newYs = [ point.y_bottom, point.y_top ];
+      }
+      newYs[0] = this.area.h * newYs[0] + this.area.y;
+      newYs[1] = this.area.h * newYs[1] + this.area.y;
+      if (!isNaN(prevX)) {
         if (stepPlot) {
-          newYs = [ point.y_bottom, point.y_top ];
-          prevY = point.y;
+          ctx.moveTo(prevX, newYs[0]);
         } else {
-          newYs = [ point.y_bottom, point.y_top ];
+          ctx.moveTo(prevX, prevYs[0]);
         }
-        newYs[0] = this.area.h * newYs[0] + this.area.y;
-        newYs[1] = this.area.h * newYs[1] + this.area.y;
-        if (!isNaN(prevX)) {
-          if (stepPlot) {
-            ctx.moveTo(prevX, newYs[0]);
-          } else {
-            ctx.moveTo(prevX, prevYs[0]);
-          }
-          ctx.lineTo(point.canvasx, newYs[0]);
-          ctx.lineTo(point.canvasx, newYs[1]);
-          if (stepPlot) {
-            ctx.lineTo(prevX, newYs[1]);
-          } else {
-            ctx.lineTo(prevX, prevYs[1]);
-          }
-          ctx.closePath();
+        ctx.lineTo(point.canvasx, newYs[0]);
+        ctx.lineTo(point.canvasx, newYs[1]);
+        if (stepPlot) {
+          ctx.lineTo(prevX, newYs[1]);
+        } else {
+          ctx.lineTo(prevX, prevYs[1]);
         }
-        prevYs = newYs;
-        prevX = point.canvasx;
+        ctx.closePath();
       }
+      prevYs = newYs;
+      prevX = point.canvasx;
     }
     ctx.fill();
   }