react-d3-components
react-d3-components copied to clipboard
Bar Graph not ready for negative values
How would you recommend fixing negative values in barChar? I can't explain properly, so I'll show you an example:
2010: 0+0+0+0 2011: 0+0+0+0 2012: 0+0+0+0 2013: 0+5+8+0 2014: -38+0+13+0 2015: 45+12+130+0 2016: 0+0+0+0
I think that the xAxis should stay in y=0, and the negative values would go under it.
That's interesting! I never considered that.
Let me ask if I understand you correctly.
13
should be on top of the x-axis and -38
should be below the x-axis?
So all negatives stack below and all positives stack above right?
Exacly! And several negatives would stack bellow each other. I don't think it should be too hard to implement, since you have the concept at the Scatter Graph.
Did you have some time to try it?
I tried it but there are still some unsolved issues.
- What to do with the labels?
- Special handling for grouped bar chart
See here:
Fixed the grouped chart, but no good idea what to do with the labels.
The only two options I see is either let it in the same place, but over the column bar, or push all the labels down, bellow the graphic.
Yep, I can't see a much better way without total customization. I'll change the rendering order, I hope that's good enough.