diff --git a/src/component/dataZoom/SliderZoomView.ts b/src/component/dataZoom/SliderZoomView.ts index 4c1a66e83a..8943658e8d 100644 --- a/src/component/dataZoom/SliderZoomView.ts +++ b/src/component/dataZoom/SliderZoomView.ts @@ -292,8 +292,14 @@ class SliderZoomView extends DataZoomView { // Position barGroup const rect = thisGroup.getBoundingRect([sliderGroup]); - thisGroup.x = location.x - rect.x; - thisGroup.y = location.y - rect.y; + // there is only scaleX on sliderGroup. + thisGroup.scaleX = this._size[0] / rect.width; + // scaleY on sliderGroup is a bad idea. + // Because of the moveHandleSize maybe greater than zoom bar height. + // clip is better than scale hard. + const scaleY = this._size[1] / rect.height; + thisGroup.x = location.x - rect.x * thisGroup.scaleX; + thisGroup.y = location.y - rect.y * scaleY; thisGroup.markRedraw(); } diff --git a/test/dataZoom-clip.html b/test/dataZoom-clip.html index b360ee9716..8a120739f9 100644 --- a/test/dataZoom-clip.html +++ b/test/dataZoom-clip.html @@ -39,6 +39,7 @@
+
@@ -290,6 +291,54 @@ + + @@ -298,4 +347,4 @@ - \ No newline at end of file +