Skip to content

fix: align toolbox dataView columns by category when series differ#21619

Open
mvanhorn wants to merge 1 commit into
apache:masterfrom
mvanhorn:fix/21610-align-toolbox-dataview-columns-by-category-when-se
Open

fix: align toolbox dataView columns by category when series differ#21619
mvanhorn wants to merge 1 commit into
apache:masterfrom
mvanhorn:fix/21610-align-toolbox-dataview-columns-by-category-when-se

Conversation

@mvanhorn
Copy link
Copy Markdown

Summary

The toolbox dataView rendered each series as its own column with rows iterated in per-series order. When two series shared most categories but each had a few uniques, the values shifted relative to each other and the table no longer matched the chart. Builds a unified category axis across all series and emits one row per category so values line up under the same x label, with empty cells for series that don't have that category.

Why this matters

#21610 reported the exact case: a bar chart with two series whose categories diverged. The exported dataView was visually wrong even though the chart rendered correctly.

Changes

  • src/component/toolbox/feature/DataView.ts - unify category axis across series and emit per-category rows.
  • test/ut/spec/component/toolbox/ - unit tests covering the divergent-categories case and the all-categories-shared case.

Testing

New unit tests + existing dataView tests pass locally.

Fixes #21610

The toolbox dataView built one column per series with rows in series
order, which produced misaligned values when two series had different
category sets. Build a unified category axis across series and emit
one row per category so values line up under the same x label.

Fixes apache#21610
@echarts-bot
Copy link
Copy Markdown

echarts-bot Bot commented May 16, 2026

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.

To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: PR: doc ready, PR: awaiting doc, PR: doc unchanged

This message is shown because the PR description doesn't contain the document related template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Toolbox dataview incorrect for multiple series data

1 participant