From: Dan Vanderkam Date: Fri, 22 Oct 2010 02:45:13 +0000 (-0400) Subject: fixed some bugs for stacked charts X-Git-Tag: v1.0.0~622^2~4 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=41b0f691c797e9fb48574d6f2a052d039ec98faf;p=dygraphs.git fixed some bugs for stacked charts --- diff --git a/dygraph.js b/dygraph.js index d6f7edf..3b1c6d3 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1888,11 +1888,6 @@ Dygraph.prototype.drawGraph_ = function() { } var seriesExtremes = this.extremeValues_(series); - extremes[seriesName] = seriesExtremes; - var thisMinY = seriesExtremes[0]; - var thisMaxY = seriesExtremes[1]; - if (minY === null || (thisMinY != null && thisMinY < minY)) minY = thisMinY; - if (maxY === null || (thisMaxY != null && thisMaxY > maxY)) maxY = thisMaxY; if (bars) { for (var j=0; j maxY) - maxY = cumulative_y[x]; + if (cumulative_y[x] > seriesExtremes[1]) { + seriesExtremes[1] = cumulative_y[x]; + } + if (cumulative_y[x] < seriesExtremes[0]) { + seriesExtremes[0] = cumulative_y[x]; + } } } + extremes[seriesName] = seriesExtremes; datasets[i] = series; }