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.

X Axis labels not being rotated so they overlap with each other

See original GitHub issue

I have a stacked bar chart with 3 columns. The labels for each column are large, so I’d expect them to be automatically rotated (or trimmed), but this is not happening, and so the labels overlap. Note that if I add a 4th column then the labels are rotated.

I’ve created a codepen where the overlap happens.

I’ve set the following options for the labels:

rotate: -45,
rotateAlways: false,
trim: true

Am I missing any configuration, or is this supposed to be rotating the labels as it is?

thank you!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
junedchhipacommented, Mar 30, 2019
xaxis: {
  labels: {
    show: true,
    rotate: -45,
    rotateAlways: true,
    minHeight: 100,
    maxHeight: 180,
    style: {
      colors: "red"
    }
  },
  categories: [
    "This is a large label",
    "And Another large one",
    "Just in case one more"
  ]
}
0reactions
saurabhnemadecommented, Jun 28, 2021

This is still the issue. when screen size is more it does not respect rotateAlways property and even drops some labels.

Edit: I seriously gotta use types here. I had a typo in xaxis as xAxis causing this behaviour.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rotated X-Axis labels overlap the graph itself - Stack Overflow
I am struggling with rotated x-axis labels. If they are longer than 5-6 chars, they overlap the graph as you might see here:...
Read more >
x-axis labels overlap - want to rotate labels 45º
Using that code, how can I rotate the labels on the x-axis 45º to keep them from overlapping? Advice and suggestions are welcome....
Read more >
X Axis label overlap issue - Highcharts official support forum
Hey, I want to know how to avoid overlap issue between x axis labels. And I don't want auto rotation and ellipse. I...
Read more >
Rotating axis labels in matplotlib and seaborn
Here we have the classic problem with categorical data: we need to display all the labels and because some of them are quite...
Read more >
Problems with axis labels overlapping/smashing together
The problem occurs with the axis labels and ticks, where the chart renders far too many of them into the view. Seemingly sporadically ......
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