Repository navigation
Keep the stack order when the first dataset of a stack is hidden - #12331
Open
exclusiveabhi wants to merge 1 commit into
Open
exclusiveabhi wants to merge 1 commit into
exclusiveabhi wants to merge 1 commit into
Conversation
Author
|
@LeeLenaleee @etimberg could one of you approve the CI run when you get a chance? This fixes #11978, where hiding the first dataset of a stack from the legend reorders the stacks. Happy to adjust anything. |
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 #11978
When the first dataset of a stack is hidden (for example from the legend), the stacks of a grouped stacked bar chart swap places. In the issue, hiding "Comp 1" moves stack 1 to the left of stack 0, even though "Comp 2" still has visible bars in stack 0.
_getStacks()builds the stack list in the order the stacks are first seen among the visible datasets only. With the first dataset of stack 0 hidden, stack 1 is seen first and takes the first position.Hidden datasets are now part of that walk, but only to hold the position of a stack that still has visible bars, so the stacks keep their order. A stack with no visible bars still takes no space (#6368), and
stacked: falsecharts are unchanged. The dataset lookup moved to a privategetGroupedMetas()helper.Added a test that hides the first dataset with
chart.hide(0)and checks the stack indexes and the bar positions. It fails on master.