File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
public/app/plugins/panel/graph Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,14 @@ function ($) {
21
21
var initial = last * ps ;
22
22
var len = series . datapoints . points . length ;
23
23
for ( var j = initial ; j < len ; j += ps ) {
24
- if ( series . datapoints . points [ j ] > posX ) {
25
- break ;
24
+ // Special case of a non stepped line, highlight the very last point just before a null point
25
+ if ( ( ! series . lines . steps && series . datapoints . points [ initial ] != null && series . datapoints . points [ j ] == null )
26
+ //normal case
27
+ || series . datapoints . points [ j ] > posX ) {
28
+ return Math . max ( j - ps , 0 ) / ps ;
26
29
}
27
30
}
28
- // Special case of a non stepped line, highlight the very last point just before a null point
29
- while ( ! series . lines . steps && series . datapoints . points [ initial ] != null && j > 0 && series . datapoints . points [ j - ps ] == null ) {
30
- j -= ps ;
31
- }
32
- return Math . max ( j - ps , 0 ) / ps ;
31
+ return j / ps - 1 ;
33
32
} ;
34
33
35
34
this . findHoverIndexFromData = function ( posX , series ) {
You can’t perform that action at this time.
0 commit comments