New Feature: axisLabel.autoRotate
See original GitHub issueWhat 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:
axisLabel.interval=0
will cause collision, like this:
In my opinion, autoRotate will go from 0 to 45 to 90 degrees, depending on the fit, like this:
What does the proposed API look like?
axisLabel.rotate = () => {
if(this.doesNotFit && this.autoRotate) {
this.rotate = calcRotateDegrees();
}
...
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:7
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
+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)+1, we want the feature