@@ -119,6 +119,8 @@ class SliderZoomView extends DataZoomView {
119119
120120 private _brushing : boolean ;
121121
122+ private _isOverDataInfoTriggerArea : boolean ;
123+
122124 private _dataShadowInfo : {
123125 thisAxis : Axis
124126 series : SeriesModel
@@ -611,8 +613,8 @@ class SliderZoomView extends DataZoomView {
611613 draggable : true ,
612614 drift : bind ( this . _onDragMove , this , handleIndex ) ,
613615 ondragend : bind ( this . _onDragEnd , this ) ,
614- onmouseover : bind ( this . _showDataInfo , this , true ) ,
615- onmouseout : bind ( this . _showDataInfo , this , false ) ,
616+ onmouseover : bind ( this . _onOverDataInfoTriggerArea , this , true ) ,
617+ onmouseout : bind ( this . _onOverDataInfoTriggerArea , this , false ) ,
616618 z2 : 5
617619 } ) ;
618620
@@ -707,12 +709,12 @@ class SliderZoomView extends DataZoomView {
707709
708710 actualMoveZone . attr ( {
709711 draggable : true ,
710- cursor : 'default ' ,
711- drift : bind ( this . _onDragMove , this , 'all' ) ,
712- ondragstart : bind ( this . _showDataInfo , this , true ) ,
713- ondragend : bind ( this . _onDragEnd , this ) ,
714- onmouseover : bind ( this . _showDataInfo , this , true ) ,
715- onmouseout : bind ( this . _showDataInfo , this , false )
712+ cursor : 'grab ' ,
713+ drift : bind ( this . _onActualMoveZoneDrift , this ) ,
714+ ondragstart : bind ( this . _onActualMoveZoneDragStart , this ) ,
715+ ondragend : bind ( this . _onActualMoveZoneDragEnd , this ) ,
716+ onmouseover : bind ( this . _onOverDataInfoTriggerArea , this , true ) ,
717+ onmouseout : bind ( this . _onOverDataInfoTriggerArea , this , false )
716718 } ) ;
717719 }
718720
@@ -909,6 +911,11 @@ class SliderZoomView extends DataZoomView {
909911 : valueStr ;
910912 }
911913
914+ private _onOverDataInfoTriggerArea ( isOver : boolean ) : void {
915+ this . _isOverDataInfoTriggerArea = isOver ;
916+ this . _showDataInfo ( isOver ) ;
917+ }
918+
912919 /**
913920 * @param isEmphasis true: show, false: hide
914921 */
@@ -931,6 +938,21 @@ class SliderZoomView extends DataZoomView {
931938 && this . api [ toShow ? 'enterEmphasis' : 'leaveEmphasis' ] ( displayables . moveHandle , 1 ) ;
932939 }
933940
941+ private _onActualMoveZoneDrift ( dx : number , dy : number , event : ZRElementEvent ) {
942+ this . api . getZr ( ) . setCursorStyle ( 'grabbing' ) ;
943+ this . _onDragMove ( 'all' , dx , dy , event ) ;
944+ }
945+
946+ private _onActualMoveZoneDragStart ( event : ZRElementEvent ) {
947+ ( event . target as Displayable ) . attr ( 'cursor' , 'grabbing' ) ;
948+ this . _showDataInfo ( true ) ;
949+ }
950+
951+ private _onActualMoveZoneDragEnd ( event : ZRElementEvent ) {
952+ ( event . target as Displayable ) . attr ( 'cursor' , 'grab' ) ;
953+ this . _onDragEnd ( ) ;
954+ }
955+
934956 private _onDragMove ( handleIndex : 0 | 1 | 'all' , dx : number , dy : number , event : ZRElementEvent ) {
935957 this . _dragging = true ;
936958
@@ -954,7 +976,11 @@ class SliderZoomView extends DataZoomView {
954976
955977 private _onDragEnd ( ) {
956978 this . _dragging = false ;
957- this . _showDataInfo ( false ) ;
979+
980+ if ( ! this . _isOverDataInfoTriggerArea ) {
981+ // Drag end may occur on draggable bars, where data info should be still shown.
982+ this . _showDataInfo ( false ) ;
983+ }
958984
959985 // While in realtime mode and stream mode, dispatch action when
960986 // drag end will cause the whole view rerender, which is unnecessary.
0 commit comments