X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=src%2Fdygraph.js;h=e0fcb58caddd9dd73c1e4250b36ac67555efb6fa;hb=660bb307f01c14f7d7d1b839812840fb179481ec;hp=ce9f11072a789f6c83b146903fc3b7a55f9af2d4;hpb=f0e472002843b5e61aa9467f97f755280c91a46b;p=dygraphs.git diff --git a/src/dygraph.js b/src/dygraph.js index ce9f110..e0fcb58 100644 --- a/src/dygraph.js +++ b/src/dygraph.js @@ -1710,8 +1710,8 @@ Dygraph.prototype.animateSelection_ = function(direction) { Dygraph.prototype.updateSelection_ = function(opt_animFraction) { /*var defaultPrevented = */ this.cascadeEvents_('select', { - selectedRow: this.lastRow_, - selectedX: this.lastx_, + selectedRow: this.lastRow_ === -1 ? undefined : this.lastRow_, + selectedX: this.lastx_ === -1 ? undefined : this.lastx_, selectedPoints: this.selPoints_ }); // TODO(danvk): use defaultPrevented here? @@ -1787,6 +1787,10 @@ Dygraph.prototype.updateSelection_ = function(opt_animFraction) { * Manually set the selected points and display information about them in the * legend. The selection can be cleared using clearSelection() and queried * using getSelection(). + * + * To set a selected series but not a selected point, call setSelection with + * row=false and the selected series name. + * * @param {number} row Row number that should be highlighted (i.e. appear with * hover dots on the chart). * @param {seriesName} optional series name to highlight that series with the