Autoexpand does not work for axes
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 CodePen 复现开始,并使用 Plotly 2.35.2 将其与链接的 Plotly 折线图和散点图文档示例进行比较。检查为什么放大的 y 轴刻度标签不会触发左边距扩展,而更长的图例会触发;完成的标准是:无需手动设置边距,y 轴标签仍能完整显示。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100