Display positive/negative values on a stacked bar chart? #1624
-
https://airbnb.io/visx/barstack Is there a way to display negative values on a stack bar chart? I'm combing the documentation and not seeing anything besides use D3. I don't want to have to use D3 if I don't have too. My example: https://codesandbox.io/s/interesting-rumple-vqou24 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi! Yes see this issue/discussion #291 tl;dr you need to set https://codesandbox.io/s/naughty-aryabhata-y7s051?file=/Example.tsx |
Beta Was this translation helpful? Give feedback.
Hi! Yes see this issue/discussion #291
tl;dr you need to set
stack="diverging
and probably update youry-scale
domain logic. Your sandbox didn't have any negative values, but here's one that does (note the y-scale domain logic isn't technically correct/could use improvements)https://codesandbox.io/s/naughty-aryabhata-y7s051?file=/Example.tsx