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

Null values show up as thin bars in Bar chart if you set an axis range including 0. #4499

Closed
kei51e opened this issue Jan 20, 2020 · 4 comments · Fixed by #4522
Closed

Null values show up as thin bars in Bar chart if you set an axis range including 0. #4499

kei51e opened this issue Jan 20, 2020 · 4 comments · Fixed by #4522
Assignees
Labels
bug something broken

Comments

@kei51e
Copy link

kei51e commented Jan 20, 2020

If you have null values in y, those show up as thin bars in Bar chart if you set an axis range that includes 0.

image

Here is a pen.

https://codepen.io/kei51/pen/KKwraMX

It doesn't happen on an older version of Plotly like 1.47.4.

https://codepen.io/kei51/pen/XWJypEO

@etpinard
Copy link
Contributor

Thanks for reporting!

This should have been fixed as part of #4056 unless I'm missing something. @archmoj can you comment?

@etpinard etpinard added the bug something broken label Jan 27, 2020
@archmoj
Copy link
Contributor

archmoj commented Jan 28, 2020

Hmm... this demo using #4056 renders OK.
The problem should be caused by another PR in 1.48.0
Investigating...

@archmoj archmoj self-assigned this Jan 28, 2020
@archmoj
Copy link
Contributor

archmoj commented Jan 28, 2020

Improved bug demo.
This is only a problem in interactive mode. Download PNG works OK (does not show empty bars).
Related to this block:

function expandToVisible(v, vc) {
// if it's not in danger of disappearing entirely,
// round more precisely
return Math.abs(v - vc) >= 2 ? roundWithLine(v) :
// but if it's very thin, expand it so it's
// necessarily visible, even if it might overlap
// its neighbor
(v > vc ? Math.ceil(v) : Math.floor(v));
}

@kei51e
Copy link
Author

kei51e commented Jan 29, 2020

Thank you very much for the fix!

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

Successfully merging a pull request may close this issue.

3 participants