Skip to content

Histogram does not correctly display trace with single X value (when another trace has more than one X value) #6661

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

Closed
sgalla opened this issue Jun 30, 2023 · 3 comments

Comments

@sgalla
Copy link

sgalla commented Jun 30, 2023

From what I can tell, this specifically happens when the histogram has more than one trace where one trace has more than one X value and the other trace has one X value.

Here is a codepen that demonstrates the bug: https://codepen.io/Shannon-Gallagher-the-bold/pen/XWyRVar

It appears that "Results B", the dataset with a single result, renders as a line at the exact X value, rather than the bar overlay that is the full width of the bin. Adding an X value to trace2 ("Results B") results in expected behavior (uncomment line 25 in the codepen and comment line 24).

Below are photos for reference. The first shows the broken behavior when the trace has a single X value. The second shows expected behavior that is seen when a second X value is added to the trace data.

(Note: I do see this working as expected up until version 1.41.3.)

Screen Shot 2023-06-30 at 11 49 39 AM Screen Shot 2023-06-30 at 11 49 50 AM
@28raining
Copy link
Contributor

Created PR to fix this #6725

The PR does fix this issue. But, like I said in PR, because May is 31 days and June is 30 then using a single point in May ends up making the bar slightly wider. Fixing that would be a much bigger code change... and could break other stuff.

@28raining
Copy link
Contributor

Note you can use bingroup to fix this.
I think you should be using bingroup anyway, but the fix I made removes that requirement
https://codepen.io/28raining/pen/OJrxjBo

@gvwilson
Copy link
Contributor

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

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

No branches or pull requests

3 participants