Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

same-position/within-trace bar placement when barmode=group #3651

Closed
nicolaskruchten opened this issue Mar 19, 2019 · 4 comments · Fixed by #3680
Closed

same-position/within-trace bar placement when barmode=group #3651

nicolaskruchten opened this issue Mar 19, 2019 · 4 comments · Fixed by #3680
Assignees
Milestone

Comments

@nicolaskruchten
Copy link
Member

Consider the following pen: https://codepen.io/nicolaskruchten/pen/RdYWdz?editors=0010

The red and cyan bars aren't being shown because within each trace at the same position, the bars are behaving as if the barmode was "overlay". I believe that the default behaviour should be "relative" instead because it's the only one that always shows all the data!).

If we can't agree that the current behaviour is a bug, then we should create a new attr that defaults to "overlay" but allows us to set it to "relative" or "stack" as required.

@etpinard etpinard added this to the v1.46.0 milestone Mar 21, 2019
@etpinard
Copy link
Contributor

Interestingly under barmode: 'relative', we appear to do the right thing already: https://codepen.io/etpinard/pen/GeeXmQ?editors=0010

This might just be an issue with barmode: 'group'.

@etpinard etpinard self-assigned this Mar 25, 2019
@nicolaskruchten
Copy link
Member Author

Yes, this is exclusively a problem with barmode=group.

@etpinard
Copy link
Contributor

@nicolaskruchten I'm starting to think we could merge a "fix" for this bug w/o adding a new attribute.

Here's my first attempt: https://github.com/plotly/plotly.js/compare/unhide-grouped-bars-within-trace - which doesn't break any existing test.

Your codepen now looks like: https://codepen.io/etpinard/pen/YggmQx?editors=0010

image

and note that the new logic only has an effect when barmode: 'group', so under barmode: 'overlay' we (still) get:

image

@nicolaskruchten
Copy link
Member Author

This is pretty much my ideal fix I think, without looking at the implementation

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

Successfully merging a pull request may close this issue.

2 participants