[Bug] Regression in 6.x: dataZoom slider showDataShadow renders nothing when the shadow-source series has a single data point on a time axis (NaN from zero-width extent)
@iamankushpandit is already working on this.
Since Jun 18, 2026.
- #21658 by @jesco-absolut — closed without merging
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- data-visualization
Research direction
Start at SliderZoomView._renderDataShadow and reproduce the issue with the linked CodePen or the single-point time-axis option. Compare the 6.x behavior with 5.6.0, focusing on the zero-width extent and the existing step guard. Done means the data shadow renders without NaN coordinates for a single-point source and still handles multiple series correctly.
Written by the indexing model from the issue text.
Description
Version
Affected: 6.0.0 and 6.1.0 (latest). Regression — works in 5.x (tested 5.3.2 and 5.6.0). Introduced in 6.0.0 (the time-axis dataShadow positioning; first present in 6.0.0-beta.1).
Link to Minimal Reproduction
Steps to Reproduce
- xAxis: { type: 'time' }, dataZoom: [{ type: 'slider', showDataShadow: true }].
- Give the shadow-source series a SINGLE data point.
- The slider shadow is empty/missing.
Minimal option (the slider shadow vanishes on 6.x; renders on 5.x):
option = {
xAxis: { type: 'time' },
yAxis: { type: 'value' },
dataZoom: [{ type: 'slider', showDataShadow: true }],
series: [{ type: 'line', data: [['2025-07-01', 285]] }]
};
Real-world variant: with multiple series, the first eligible series is
chosen as the shadow source, so a single-point first series breaks the
shadow even when later series are dense.
Current Behavior
In SliderZoomView._renderDataShadow (6.x), the time-axis branch computes:
normalizationConstant = size[0] / (thisDataExtent[1] - thisDataExtent[0]);
thisCoord = isTimeAxis ? (value - thisDataExtent[0]) * normalizationConstant : thisCoord + step;
For a single-point series the x-extent has zero width, so
normalizationConstant = Infinity and thisCoord = 0 * Infinity = NaN. The
shadow polygon receives a NaN vertex and does not render.
Measured shadow polygon on 6.1.0: points [[size,0],[0,0],[NaN,15]] (hasNaN=true).
On 5.3.2/5.6.0 the same option yields finite, step-based points (hasNaN=false).
Note the adjacent step path WAS guarded against divide-by-zero
(Math.max(1, data.count() - 1)); the new time-axis division was not.
Expected Behavior
A single-point (zero-width-extent) shadow source should render the same way
it did in 5.x (no NaN), or fall back gracefully — not erase the shadow.
Fix: guard the time-axis normalization when (thisDataExtent[1] -
thisDataExtent[0]) === 0 (e.g. fall back to the step-based coordinate or
clamp to 0), mirroring the existing Math.max guard on step.
Happy to PR this.
Environment
- OS: macOS 15
- Browser: Chrome 126
- Framework: Angular
Any additional comments?
This is distinct from the timeline component — the issue is specifically
in the dataZoom-slider shadow source-series selection.
The slider's data shadow is empty on 6.x. Switch the CDN to echarts/5.6.0 and the shadow appears — same option.
- Dominant language
- TypeScript
- Stars
- 67.7k
- Forks
- 19.9k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/echarts
-
[Bug] String formatter templates only replace the first occurrence of `{a}`/`{b}`/`{c}`Possibly taken A pull request linked to this issue is open or already merged. Openen pending
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
-
[Bug] Inverse axis collapses the grid with outerBoundsContain when a tick is near the axis edgePossibly taken A pull request linked to this issue is open or already merged. Openen pending
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
en pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
en pending
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
[Bug] The zoom cursor in the toolbox area is incorrectPossibly taken @waterWang claimed this 98 days ago. Openbug en pending
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Similar issues
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
lingdojo/kana-dojo#34223 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
bug status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
mastra-ai/mastra#30587 · 1 comment ·
Maintainers usually reply within 1 day
-
area:web p2 product:business triage:active type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
cuadrao-ai/argus#2228 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
embedpdf/embed-pdf-viewer#1098 ·
Maintainers usually reply within 1 day
-
.Needs Triage .Team/Metabot Priority:P3 Type:Bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
metabase/metabase#87252 · 1 comment ·
Maintainers usually reply within 1 day