X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=1aa43eac71d32204d5b006cca81257c470b999a9;hb=74934c8399f3ae7ba8141049680f270fb9697196;hp=8a0ee087d6264987ad3c54352147f210dd8d9c4f;hpb=e988d192a87ace02365a765ffd5455b1d7b5b88e;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 8a0ee08..1aa43ea 100644 --- a/dygraph.js +++ b/dygraph.js @@ -280,7 +280,6 @@ Dygraph.DEFAULT_ATTRS = { customBars: false, fillGraph: false, fillAlpha: 0.15, - fillStepPlot: false, connectSeparatedPoints: false, stackedGraph: false, @@ -1105,6 +1104,7 @@ Dygraph.prototype.createInterface_ = function() { // TODO(danvk): any other styles that are useful to set here? this.graphDiv.style.textAlign = 'left'; // This is a CSS "reset" + this.graphDiv.style.position = 'relative'; enclosing.appendChild(this.graphDiv); // Create the canvas for interactive parts of the chart. @@ -2499,6 +2499,7 @@ Dygraph.prototype.gatherDatasets_ = function(rolledSeries, dateWindow) { var extremes = {}; // series name -> [low, high] var seriesIdx, sampleIdx; var firstIdx, lastIdx; + var axisIdx; // Loop over the fields (series). Go from the last to the first, // because if they're stacked that's how we accumulate the values. @@ -2569,7 +2570,11 @@ Dygraph.prototype.gatherDatasets_ = function(rolledSeries, dateWindow) { seriesName, boundaryIds[seriesIdx-1][0]); if (this.getBooleanOption("stackedGraph")) { - Dygraph.stackPoints_(seriesPoints, cumulativeYval, seriesExtremes, + axisIdx = this.attributes_.axisForSeries(seriesName); + if (cumulativeYval[axisIdx] === undefined) { + cumulativeYval[axisIdx] = []; + } + Dygraph.stackPoints_(seriesPoints, cumulativeYval[axisIdx], seriesExtremes, this.getBooleanOption("stackedGraphNaNFill")); }