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

Bug: Bars with zero value are not able to render labels #2646

Closed
tigerabrodi opened this issue Sep 9, 2024 · 1 comment
Closed

Bug: Bars with zero value are not able to render labels #2646

tigerabrodi opened this issue Sep 9, 2024 · 1 comment

Comments

@tigerabrodi
Copy link

Please 🫠 , don't close this issue like done with #2172.

It seems like the issue in #874 is back. I am unable to render a zero above the bar when it's value is 0. The fields with value 0 get excluded completely. I'd assume something like !{the value} is done in the source which means if the value is the number 0, the expression !0 results in true.

What do I expect?

Explicitly check if undefined, otherwise if the value number 0, it should be totally fine to include the field!

Looking in the source code, the function filterZerosIfLog in the file packages/bar/src/compute/stacked.ts seems suspicious. But I'd need to take a deeper look to properly fix this.

Pinging people who had this issue in the past, and it doesn't seem to be resolved yet, or it's back!

cc @RobertHosking @dooleyb1

@tigerabrodi tigerabrodi changed the title Bars with zero value are not able to render labels Bug: Bars with zero value are not able to render labels Sep 9, 2024
@plouc
Copy link
Owner

plouc commented Oct 21, 2024

Labels aren't rendered, as a bar with a value of 0 is not rendered, it cannot be rendered as visually 0 shouldn't take any space, however it's included in the legend, which is what #874 was about.

I don't plan to support rendering labels for 0 values.

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

2 participants