Make auto-margin step dependent on axis label span
See original GitHub issueHi there, I have some graphs with particularly long labels/axis string values and I’m wondering if there’s a way to get them to fit without changing the layout.margin
option because I’m using dynamic data.
Here’s CodePen showing a longer label being cut off on both a vertically and horizontally-oriented bar chart - http://codepen.io/mnoble01/pen/zqxZQx.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:7
- Comments:42 (15 by maintainers)
Top Results From Across the Web
PGFPlots - How to make multiline axis labels with non-boxed ...
This answer describes how to create multiline axis labels for boxed axes. However, when I try to do this with non-boxed axes it...
Read more >plotly x axis title position - amiraartdecor.it
Make the chart readable by adding titles to the x and y axes. ... Mar 21, 2017 · Make auto-margin step dependent on...
Read more >Plotly R: setting the spacing between axis label and axis ticks ...
By setting standoff and turning on automargin , plotly.js will push the margins to fit the axis title at given standoff distance. Example:...
Read more >ValueAxis | JavaScript Charts v. 3 - amCharts
Property Type Default
autoGridCount Boolean true
autoRotateAngle Number
autoRotateCount Number
Read more >Managing Axes in OVERLAY Layouts - SAS Help Center
The following examples show how axis labels are determined and how to set an axis label. Consider the following DATA step, which generates ......
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
There’s no automated way to do that at the moment. Making the
auto-margin
step dive into the axis labels would be a great addition though.Renaming this issue accordingly.
I’m happy to report that this is now fixed, with the addition of the
*axis.automargin
attribute (see #2243). When set totrue
it will grow the plot margins so as to make room for both the tick labels and axis title 😃Some caveats: this doesn’t interact with the legend’s positioning, so tick labels can still conflict there, and for x-axes at the top, can conflict with the plot title, but it’s a good start! Here’s the mock that shows it in action: https://github.com/plotly/plotly.js/blob/master/test/image/baselines/long_axis_labels.png