X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=1745f058bdc35142f73e4b9ac2216fab380e23a1;hb=ad7785b8f9a1564b8d18a8ee9a1036936298bb31;hp=9570d3c2f26e553cab7d10ee409cfd55ef40486e;hpb=8c31c7db4c13940f8a6bbab254a72a7991ae82ee;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 9570d3c..1745f05 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1104,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. @@ -2123,10 +2124,14 @@ Dygraph.prototype.setSelection = function(row, opt_seriesName, opt_locked) { this.lastRow_ = row; for (var setIdx = 0; setIdx < this.layout_.points.length; ++setIdx) { var points = this.layout_.points[setIdx]; - var setRow = row - this.getLeftBoundary_(setIdx); - if (setRow < points.length) { - var point = points[setRow]; - if (point.yval !== null) this.selPoints_.push(point); + for (var pointIdx = 0; pointIdx < points.length; ++pointIdx) { + var point = points[pointIdx]; + if (point.idx == row) { + if (point.yval !== null) { + this.selPoints_.push(point); + } + break; + } } } } else {