fix: align toolbox dataView columns by category when series differ#21619
Open
mvanhorn wants to merge 1 commit into
Open
fix: align toolbox dataView columns by category when series differ#21619mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
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
|
Thanks for your contribution! 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: This message is shown because the PR description doesn't contain the document related template. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The toolbox
dataViewrendered 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