-
I'm trying to eliminate the gap that appears between the edge of the chart and the start of the YAxis labels, indicated by this red line i drew: I saw this as a possibility which makes sense, though still a bit of a hack to get it to work. However, since the library is calculating the actual labels for my number axis, I'm not sure how i can grab those values. Arbitrary example:
My YAxis:
Custom Tick:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Left offset is You cannot (currently) easily grab the domain/range that recharts calculates for you. In 3.0 we will expose hooks that will allow you to get this information back - for now the only thing I could suggest leads to more hacks which you may not want to rely on. You can use the |
Beta Was this translation helpful? Give feedback.
Left offset is
margin
+YAxis
width so make sure margin is accounted for (you have direct control over that).You cannot (currently) easily grab the domain/range that recharts calculates for you.
In 3.0 we will expose hooks that will allow you to get this information back - for now the only thing I could suggest leads to more hacks which you may not want to rely on.
You can use the
Customized
component to do all sorts of crazy things and access all/most of the internal state of recharts, but this will be going away in 3.0 with hooks in its place (as its hard to document and maintain). There you have access to what the entire left offset value is. The codesandbox should show using it, but …