How to prevent drawing bars in a bar chart when all values are zero? #2359
Answered
by
Fil
mwaibel-go
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
Fil
Jan 28, 2026
Replies: 1 comment 1 reply
-
|
If you want the y domain to never be collapsed, you could introduce a mark that adds a non-zero value into the domain; and you can use Plot.plot({
marks: [
Plot.tickY([1], { filter: false }),
Plot.barY([0])
]
}) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mwaibel-go
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

If you want the y domain to never be collapsed, you could introduce a mark that adds a non-zero value into the domain; and you can use
filter: falseto make this mark render nothing.