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.

Make auto-margin step dependent on axis label span

See original GitHub issue

Hi 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:closed
  • Created 8 years ago
  • Reactions:7
  • Comments:42 (15 by maintainers)

github_iconTop GitHub Comments

6reactions
etpinardcommented, Mar 1, 2016

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.

2reactions
nicolaskruchtencommented, Mar 2, 2018

I’m happy to report that this is now fixed, with the addition of the *axis.automargin attribute (see #2243). When set to true 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

Read more comments on GitHub >

github_iconTop 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 >

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