-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Negative numbers do not render in bar chart when there is only one key #165
Comments
margin={{top: 60, right: 80, bottom: 60, left: 80}} |
data={[{{country: "AD", hot dogs: -55}}, {{country: "AE", hot dogs: 7}}]} |
dont put values inside { } |
Example for reference => https://codesandbox.io/s/k346rpz98v |
Same problem here. And adding one empty key does fix it, even though it seems hacky :) |
Can someone share a version of this with the workaround please? I can't get the negative bar to render. |
So what is the right way to fix this? |
@zepplock did you actually look at the first 3 posts I made and try those codes? |
I did, if I add a new "foo" key like original poster suggested it works, but this looks like a hack, right? |
@zepplock I was talking about my posts. The original poster suggestions is hacky. |
I tried your suggestions but there's still an issue. Take a look at codesandbox link @pluoc posted. It has no negative value unless you add |
Gotcha. That is definitely hacky but I think that empty key acts as a baseline so the negative values can be rendered. |
This seems to be related to this d3-shape issue : d3/d3-shape#114 |
Experiencing this issue as well, looks like a simple fix was also created d3/d3-shape#115 |
Going to close this as it appears to be fixed now. |
Take the example here:
http://nivo.rocks/storybook/?selectedKind=Bar&selectedStory=stacked%20horizontal&full=0&down=1&left=1&panelRight=0&downPanel=storybooks%2Fstorybook-addon-knobs
Change the data to have negative values, and have only one key field:
and the negative value bars do not render.
But adding an extra key makes it work, i.e.
or
The text was updated successfully, but these errors were encountered: