diff --git a/src/component/dataZoom/SliderZoomView.ts b/src/component/dataZoom/SliderZoomView.ts index b542817ed8..30422c9c52 100644 --- a/src/component/dataZoom/SliderZoomView.ts +++ b/src/component/dataZoom/SliderZoomView.ts @@ -294,8 +294,11 @@ class SliderZoomView extends DataZoomView { // Position barGroup const rect = thisGroup.getBoundingRect([sliderGroup]); - thisGroup.x = location.x - rect.x; - thisGroup.y = location.y - rect.y; + const rectX = isNaN(rect.x) ? 0 : rect.x; + const rectY = isNaN(rect.y) ? 0 : rect.y; + + thisGroup.x = location.x - rectX; + thisGroup.y = location.y - rectY; thisGroup.markRedraw(); } diff --git a/test/dataZoom-single-datapoint.html b/test/dataZoom-single-datapoint.html new file mode 100644 index 0000000000..bd78b45554 --- /dev/null +++ b/test/dataZoom-single-datapoint.html @@ -0,0 +1,93 @@ + + + + +
+ + + + + + + + + + + + + + + + + + +