Add var declaration to prevent breaking stacked graphs.
[dygraphs.git] / dygraph-canvas.js
index 77d8cc4..b184717 100644 (file)
@@ -743,7 +743,7 @@ DygraphCanvasRenderer.prototype._renderLineChart = function() {
           }
           var newYs;
           if (stackedGraph) {
-            lastY = baseline[point.canvasx];
+            var lastY = baseline[point.canvasx];
             if (lastY === undefined) lastY = axisY;
             baseline[point.canvasx] = point.canvasy;
             newYs = [ point.canvasy, lastY ];