plotly / plotly/plotly.js

Autoexpand does not work for axes

未关闭
#7,266 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

documentation feature P3
主要语言
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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 CodePen 复现开始,并使用 Plotly 2.35.2 将其与链接的 Plotly 折线图和散点图文档示例进行比较。检查为什么放大的 y 轴刻度标签不会触发左边距扩展,而更长的图例会触发;完成的标准是:无需手动设置边距,y 轴标签仍能完整显示。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。