File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1171,21 +1171,24 @@ async function loadForecast() {
11711171 }
11721172 } ,
11731173
1174- onHover : ( event , elements , chart ) => {
1175- if ( elements . length ) {
1176- chart . setActiveElements ( [ {
1177- datasetIndex : 2 ,
1178- index : elements [ 0 ] . index
1179- } ] ) ;
1180- chart . update ( 'none' ) ;
1181- } else {
1182- chart . setActiveElements ( [ {
1183- datasetIndex : 2 ,
1184- index : appState . activeIndex
1185- } ] ) ;
1186- chart . update ( 'none' ) ;
1187- }
1188- } ,
1174+ onHover : ( event , elements , chart ) => {
1175+ if ( elements . length ) {
1176+ const hoverIndex = elements [ 0 ] . index ;
1177+ if ( hoverIndex !== appState . activeIndex ) {
1178+ chart . setActiveElements ( [ {
1179+ datasetIndex : 2 ,
1180+ index : hoverIndex
1181+ } ] ) ;
1182+ chart . update ( 'none' ) ;
1183+ }
1184+ } else {
1185+ chart . setActiveElements ( [ {
1186+ datasetIndex : 2 ,
1187+ index : appState . activeIndex
1188+ } ] ) ;
1189+ chart . update ( 'none' ) ;
1190+ }
1191+ }
11891192 }
11901193 } ) ;
11911194
You can’t perform that action at this time.
0 commit comments