Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoexpand does not work for axes #7266

Open
shadow-identity opened this issue Nov 8, 2024 · 2 comments
Open

Autoexpand does not work for axes #7266

shadow-identity opened this issue Nov 8, 2024 · 2 comments
Labels
documentation written for humans feature something new P3 backlog

Comments

@shadow-identity
Copy link

Seems like autoexpand does not work (or I do something wrong). In the example below, I increased y axis tick label size and font size, so they consume much more space, but margins are not adjusted, and labels are partially hidden outside of the chart container.

Reproduction

https://codepen.io/shadow-identity/pen/abeQprO

This is slightly modified example from the documentation: https://plotly.com/javascript/line-and-scatter/#line-and-scatter-plot

What is modified:

  • y axis tick values increased to have more symbols
  • y axis tick font size increased
  • I also tested it with explicitly set margin: {autoexpand: true}, but it does not change anything

Expected results

Grid size should be reduced (margin should be added to the left) to keep y axis ticks visible

Actual results

Y axis ticks are partially hidden

Environment

Chrome 130, Firefox 133 beta
Plotly from https://cdn.plot.ly/plotly-2.35.2.min.js

Additional info

At the same time, legend seems to increase corresponding margin. I increased the name length of one of the series to check if it will expand the margin, and it works.

@shadow-identity
Copy link
Author

OK, I found that additionally to autoexpand user have to set automargin: true on axes. I think it would be great to mention this in autoexpand documentation, because it is very unclear, especially if you just trying to use the library for the first time.

@gvwilson gvwilson added feature something new documentation written for humans P3 backlog labels Nov 11, 2024
@gvwilson
Copy link
Contributor

thanks for following up @shadow-identity - I'll see if we can get it into the docs for an upcoming release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation written for humans feature something new P3 backlog
Projects
None yet
Development

No branches or pull requests

2 participants