File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -109,9 +109,13 @@ Legend.prototype.select = function(e) {
109
109
// find the closest data point by checking the currently highlighted series,
110
110
// or fall back to using the first data point available
111
111
var highlightSeries = e . dygraph . getHighlightSeries ( )
112
- var point = highlightSeries ?
113
- points . find ( p => p . name === highlightSeries ) :
114
- points [ 0 ] ;
112
+ var point ;
113
+ if ( highlightSeries ) {
114
+ point = points . find ( p => p . name === highlightSeries ) ;
115
+ if ( ! point )
116
+ point = points [ 0 ] ;
117
+ } else
118
+ point = points [ 0 ] ;
115
119
// determine floating [left, top] coordinates of the legend div
116
120
// within the plotter_ area
117
121
// offset 50 px to the right and down from the first selection point
You can’t perform that action at this time.
0 commit comments