[Bug] dataZoom showDataShadow can use an unrepresentative series in multi-series charts
- Dominant language
- JavaScript
- Stars
- 262
- Forks
- 204
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 4
Description
## Bug report
### Version
Apache ECharts 6.0.0
### What is expected?
When `dataZoom` is configured with `type: 'slider'` and `showDataShadow: true` on a chart with multiple series, the shadow in the slider should provide a representative overview of the chart data.
In particular, it should not depend on a sparse or otherwise unrepresentative first eligible series when another eligible series provides a better overview.
### What is actually happening?
In multi-series charts, the slider shadow appears to be derived from a single internally chosen representative series.
This can produce a misleading or apparently broken shadow when:
- the first eligible series is sparse
- a later eligible series is denser and better represents the visible data
- the chart contains a mix of sparse and dense series on the same controlled axis
As a result, the slider shadow can be inconsistent with what the user sees in the main chart.
### Reproduction
A minimal reproduction is a chart with:
- `dataZoom: [{ type: 'slider', showDataShadow: true }]`
- multiple series sharing the same axis
- the first eligible series containing only a few points
- a later eligible series containing dense regular data
In that setup, the slider shadow is driven by the sparse series rather than the denser, more representative one.
### Why this is a problem
`showDataShadow` acts as a visual summary of the chart. If the chosen source series is sparse or unrepresentative, the shadow no longer serves that purpose and can look broken even though the main chart is correct.
### Suggested direction
A good solution might combine explicit control with improved default behavior:
1. Add an explicit override such as `shadowSeriesIndex` on `dataZoom.slider`, so users can choose which eligible series drives the shadow when needed.
2. Improve the current automatic behavior so that when no explicit override is provided, the shadow uses a more representative eligible series instead of simply the first one found.
3. In auto mode, if the selected candidate is too sparse to produce a meaningful shadow, prefer a better candidate or fall back to no shadow rather than a misleading one.
This would preserve backward compatibility, improve the default behavior for existing charts, and give users deterministic control when necessary.
### Notes
This is distinct from the `timeline` component. The issue is in the `dataZoom-slider` shadow behavior.
I would be happy to help with a PR if this direction makes sense.
The first screenshot shows the failure mode. The second screenshot is included only as a comparison for the kind of overview behavior users expect from `showDataShadow`.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the dataZoom slider implementation for showDataShadow and trace how the eligible series is selected; the issue distinguishes this from the timeline component. Review any existing dataZoom-slider shadow tests, then define coverage for sparse and dense multi-series charts, explicit series selection, and the fallback behavior before considering the work done.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100