What unit does domainPadding use? Pixels or domain units? #590
Unanswered
balazs-edes
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to make a Line+Area chart with a label on the lowest and the highest point of the chart, that looks like this:
I'm trying to add a fixed amount of space above and below the domain (the area where chart-points are drawn), so no matter what I have enough space to draw the label.
First I tried
padding
, the issue with this, is that whatever is drawn in the padding are, it's simply clipped:Next I tried to use
domainPadding
, which kind-of works, but I'm not really sure what the units are. For example if I give the chartdomainPadding={{ top: 20, bottom: 20 }}
, there are sometimes points in the points array that are in the top 20 or bottom 20 pixel relative to the chartBounds, so if they were pixels, the padding is not respected.If domainPadding is not in pixels, what is the best way, to gain a fixed amount of drawable space on the top and bottom of the chart?
Beta Was this translation helpful? Give feedback.
All reactions