diff --git a/src/component/dataZoom/SliderZoomView.ts b/src/component/dataZoom/SliderZoomView.ts index 7069065601..b460ffee72 100644 --- a/src/component/dataZoom/SliderZoomView.ts +++ b/src/component/dataZoom/SliderZoomView.ts @@ -389,7 +389,7 @@ class SliderZoomView extends DataZoomView { const areaPoints = [[size[0], 0], [0, 0]]; const linePoints: number[][] = []; - const step = thisShadowExtent[1] / (data.count() - 1); + const step = thisShadowExtent[1] / (Math.max(1, data.count() - 1)); const normalizationConstant = size[0] / (thisDataExtent[1] - thisDataExtent[0]); const isTimeAxis = info.thisAxis.type === 'time'; let thisCoord = -step; diff --git a/test/dataZoom-timeAxis.html b/test/dataZoom-timeAxis.html new file mode 100644 index 0000000000..7e33d9aa63 --- /dev/null +++ b/test/dataZoom-timeAxis.html @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + +