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.

New Feature: axisLabel.autoRotate

See original GitHub issue

What problem does this feature solve?

If the axis labels do not fit, then autoRotate will automatically calculate axisLabel.rotate to make them fit.

axisLabel.interval='auto' will cause missing/skipped labels, like this: image

axisLabel.interval=0 will cause collision, like this: image

In my opinion, autoRotate will go from 0 to 45 to 90 degrees, depending on the fit, like this: image

What does the proposed API look like?

axisLabel.rotate = () => {
  if(this.doesNotFit && this.autoRotate) {
    this.rotate = calcRotateDegrees();
  }
  ...
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:7
  • Comments:7

github_iconTop GitHub Comments

2reactions
TuringLovesDeathMetalcommented, Jun 20, 2022

+1 for this issue. We’ve had loads of users requesting that the labels don’t overlap, but are all shown!

Also love the implementation suggested by @ataft (i.e. If labels overlap at 0 degrees, rotate them to 45 degrees, then once the labels overlap at 45 degrees, we should rotate them to 90 degrees)

I’d also add that if labels overlap at 90 degrees, then remove all labels (or go back to the auto labels where values are skipped)

0reactions
axispodcommented, Oct 14, 2022

+1, we want the feature

Read more comments on GitHub >

github_iconTop Results From Across the Web

xAxis.labels.autoRotation | highcharts API Reference
A format string for the axis label. The context is available as format string variables. For example, you can use {text} to insert...
Read more >
Auto rotate X-axis label on column chart –
In a column chart, it looks fine with the x-axis label rotation of ... I would like a new feature with autoRotation: 315...
Read more >
New in MATLAB R2021a: Auto rotation of axis tick labels -
The new auto-rotation feature removes the burden of detecting the need to rotate manually-set labels and eliminates the need to manually rotate ...
Read more >
Wrapping, truncating, and auto-rotating axis labels - amCharts
To make that happen, we will need to modify axis label template object. For an axis, this template ... categoryAxis.events.on("sizechanged", function(ev) {
Read more >
HIGHCHARTS auto-rotate x-axis labels for custom positioned ...
So you can try adding events like load and redraw to call a function to adjust the label rotation based on morganfree's comment....
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