Negative numbers do not render in bar chart when there is only one key
See original GitHub issueTake the example here:
Change the data to have negative values, and have only one key field:
<Bar
width={1000}
height={600}
margin={{top: {60}, right: {80}, bottom: {60}, left: {80}}}
data={[{{country: "AD", hot dogs: {-55}}}, {{country: "AE", hot dogs: {7}}}]}
indexBy="country"
keys={["hot dogs"]}
padding={0.2}
labelTextColor="inherit:darker(1.4)"
labelSkipWidth={16}
labelSkipHeight={16}
layout="horizontal"
enableGridY={false}
enableGridX
/>
and the negative value bars do not render.
But adding an extra key makes it work, i.e.
keys={["hot dogs", "FOO"]}
or
keys={["hot dogs", ""]}
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (2 by maintainers)
Top Results From Across the Web
Negative numbers are not displaying in a clustered bar chart
Hi, I have a spreadsheet with the periodic table elements with their melting and boiling points. I have two problems.
Read more >how to cause negative numbers in a chart … - Apple Community
This seems a simple thing, yet I find no way to do it. I have a chat that shows both positive numbers and...
Read more >A Complete Guide to Stacked Bar Charts | Tutorial by Chartio
Stacked bar charts extend the standard bar chart by dividing each bar into multiple subcategories. Learn how to best use this chart type...
Read more >Display of population data without a value or with a negative ...
In some cases, not the objects are shown in the chart, but the sign. This can for example happen in a bar chart...
Read more >Display negative values in the first quarter of a bar chart but ...
regarding the color yes but the bars should be over 0, not below, like the positive ones. – firmo23. Nov 5, 2020 at...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
dont put values inside { }
Going to close this as it appears to be fixed now.