question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to increase the space between label text and axis?

See original GitHub issue

Do you want to request a feature or report a bug?

No

What is the current behavior?

I could not able to change the space between label text and axis

screen shot 2017-08-13 at 20 58 04

Is there an API to change this? Below is my current solution, with changed width of the axis and some CSS styles

.yAxis .recharts-layer.recharts-cartesian-axis-tick text{
  transform: translate(-5px, 0);
}
.xAxis .recharts-layer.recharts-cartesian-axis-tick text {
  transform: translate(0, 10px);
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

9reactions
Graham42commented, Sep 1, 2017

I think this might work for you

<YAxis dy={-5} ... />
8reactions
ThePianoDentistcommented, Oct 10, 2017

@Graham42 's solution worked for me for the y-axis (but using dx rather than dy, so it moved the labels sideways)

for the x-axis (moving the labels down a bit). it worked in a simple fiddle. but in my actual use case the dy property gets applied but has no effect. I wonder if there’s a weird interaction between it and responsive container, or something else Im using

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set space between the axis and the label
You can set bounding by using labelpad argument like this ax.set_ylabel('Y', rotation=0, labelpad=10). also you can add space after 'Y ...
Read more >
R Adjust Space Between ggplot2 Axis Labels and Plot Area (2 ...
How to increase /decrease the space between ggplot2 axis labels and the plot area in - 2 R programming examples - vjust &...
Read more >
Increase distance between text and title on the y-axis - Intellipaat
1 Answer ... Set the values of the margin on top(t), right(r), bottom(b), and left(l) side of the element.
Read more >
Spacing between ticks and axis labels - Google Groups
Hi, It seems that there is no way to adjust the space between tick labels and axis labels. This seems to be a...
Read more >
add space between ytitle and labels - Statalist
I often use the height() option in ytitle() in order to add space between the text and the labels. However, I'm adding an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found