Skip to content

[Bug] dataZoom showDataShadow can use an unrepresentative series in multi-series charts #502

@JBorgia

Description

@JBorgia

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.
Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions