How to use ReferenceLine as separator for BarCategories?
See original GitHub issueDo you want to request a feature or report a bug?
feature proposal / approach discussion
What is the current behavior?
Before version 1.5.0 (in 1.4.4) ReferenceLine worked incorrect (1643, 1521)
And now I need to explain my problem. I’m trying to separate BarCategories with ReferenceLine like this:
It obviously worked fine before 1.5.0 just with this simple code:
{map(xValues.slice(1), xValue =>
<ReferenceLine key={xValue} x={xValue} stroke="#DBDBDB" />,
)}
But in 1.5.0, when ReferenceLine started work correctly, my lines shifted to correct positions — center of BarCategories:
So, my question is: How I can separate BarCategories with correct behaviour of ReferenceLine?
Maybe make sense to add some position
prop for ReferenceLine with values ['start', 'middle', 'end']
, that allows you to select position of your ReferenceLine inside range of x/y. Or maybe you have any ideas how to implement this behavior with current API?
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: http://jsfiddle.net/ndLhnegs/).
That’s not a bug, but example available here You can click on ‘Toggle ugly fix’ button to see my expected result
What is the expected behavior?
I described it above
Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?
Recharts: 1.4.3/1.5.0 OS: any os
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
I created PR with fix for this issues. We need just to wait while it will be merged
Yeah, ReferenceLine worked incorrect… it seems there is no working solution how we can put line between bars…