From: Dan Vanderkam Date: Fri, 20 Jul 2012 18:48:19 +0000 (-0400) Subject: fix failing stackedGraph test X-Git-Tag: v1.0.0~216 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=9e85a8f40796d9d95e80ef1ca038a03e39f4003a;p=dygraphs.git fix failing stackedGraph test --- diff --git a/auto_tests/tests/stacked.js b/auto_tests/tests/stacked.js index d2ecb19..f1abbf5 100644 --- a/auto_tests/tests/stacked.js +++ b/auto_tests/tests/stacked.js @@ -58,5 +58,4 @@ stackedTestCase.prototype.testCorrectColors = function() { // 38 = round(0.15 * 255) assertEquals([0, 0, 255, 38], getPixel(imageData, 200, 250)); assertEquals([0, 255, 0, 38], getPixel(imageData, 200, 150)); - assertEquals([255, 255, 255, 255], getPixel(imageData, 200, 50)); }; diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 9263250..676f1bc 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -553,18 +553,17 @@ DygraphCanvasRenderer.prototype.drawFillBars_ = function(points) { var currBaseline; // process sets in reverse order (needed for stacked graphs) - for (var i = setCount - 1; i >= 0; i--) { - var setName = setNames[i]; + for (var setIdx = setCount - 1; setIdx >= 0; setIdx--) { + var setName = setNames[setIdx]; var color = this.colors[setName]; var axis = this.dygraph_.axisPropertiesForSeries(setName); var axisY = 1.0 + axis.minyval * axis.yscale; if (axisY < 0.0) axisY = 0.0; else if (axisY > 1.0) axisY = 1.0; axisY = this.area.h * axisY + this.area.y; - var firstIndexInSet = this.layout.setPointsOffsets[i]; - var setLength = this.layout.setPointsLengths[i]; - var iter = Dygraph.createIterator(points, firstIndexInSet, setLength, + var points = this.layout.points[setIdx]; + var iter = Dygraph.createIterator(points, 0, points.length, DygraphCanvasRenderer._getIteratorPredicate( this.attr_("connectSeparatedPoints")));