From: Nagy Attila Gabor Date: Wed, 24 Feb 2010 21:22:44 +0000 (+0100) Subject: Google Visualization API compatible getSelection() method X-Git-Tag: v1.0.0~702^2~6^2~12 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=103b7292caaf98d842c99086c413945b1bd7f982;p=dygraphs.git Google Visualization API compatible getSelection() method - bugs: returns incorrect data is datasource is unsorted --- diff --git a/dygraph.js b/dygraph.js index 3f8f90e..d20d348 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1028,6 +1028,24 @@ Dygraph.prototype.clearSelection = function() { this.lastx_ = -1; } +/** + * Returns the number of the currently selected row + * @return int row number, of -1 if nothing is selected + * @public + */ +Dygraph.prototype.getSelection = function() { + if (!this.selPoints_ || this.selPoints_.length < 1) { + return -1; + } + + for (var row=0; row