File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
webapp/javascript/components Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import "react-dom";
5
5
import ReactFlot from "react-flot" ;
6
6
import "react-flot/flot/jquery.flot.time.min" ;
7
7
import "react-flot/flot/jquery.flot.selection.min" ;
8
+ import "react-flot/flot/jquery.flot.crosshair.min" ;
8
9
import { bindActionCreators } from "redux" ;
9
10
import { setDateRange , receiveJSON } from "../redux/actions" ;
10
11
@@ -17,6 +18,17 @@ class TimelineChart extends ReactFlot {
17
18
Math . round ( ranges . xaxis . to / 1000 )
18
19
) ;
19
20
} ) ;
21
+
22
+ $ ( `#${ this . props . id } ` ) . bind ( "plothover" , ( evt , position ) => {
23
+ if ( position ) {
24
+ this . lockCrosshair ( {
25
+ x : item . datapoint [ 0 ] ,
26
+ y : item . datapoint [ 1 ] ,
27
+ } ) ;
28
+ } else {
29
+ this . unlockCrosshair ( ) ;
30
+ }
31
+ } ) ;
20
32
}
21
33
}
22
34
You can’t perform that action at this time.
0 commit comments