fix(bar): floating bars incorrectly offset by stacked base value#12198
Open
unreal639 wants to merge 1 commit intochartjs:masterfrom
Open
fix(bar): floating bars incorrectly offset by stacked base value#12198unreal639 wants to merge 1 commit intochartjs:masterfrom
unreal639 wants to merge 1 commit intochartjs:masterfrom
Conversation
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.
Fixes: #12197
When using floating bars
(y: [start, end])withstacked: trueon a linear axis, bars sharing the same x value across multiple datasets are rendered at incorrect positions. The stacked base offset calculated byapplyStackis incorrectly added to the absolute coordinates of the floating bar, causing bars to be shifted away from their intended y range.Add a
floatingBarModeoption at the dataset level to distinguish between absolute and relative positioning of floating bars.'absolute': the floating bar is rendered at its exact [start, end] coordinates, ignoring any stacked offset.'relative': the floating bar is offset by the cumulative stack value of preceding datasets, preserving the current behavior.To avoid a breaking change,
floatingBarModecould default to'relative'to preserve existing behavior.