x axis label is inconsistent for different range of duration in line chart
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 18.3k
- 派生
- 2k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 28
描述
Hello,
I tried many ways to make the x axis value consistent with the time and font in line chart like using this.layout.xaxis["dtick"]= "M1"
this.layout.xaxis["tickmode"]= "auto",
tickformat= '%d-%b-%y \n %H:%M',
but nothing worked, range is picked dynamically.
layout = {
"showlegend": true,
"xaxis": {
"showline": true,
"showgrid": false,
"zeroline": false,
"automargin": true,
"tickformat": "%d-%b-%y \n %H:%M",
"tickangle": 0,
"dtick": "M1",
"tickmode": "auto",
"range": [
"2025-03-28 03:44:59.999",
"2025-03-28 03:45:00.001"
],
"type": "date",
"autorange": true
},
"yaxis": {
"showline": true,
"showgrid": true,
"automargin": true,
"title": {
"text": "abc Change [%]",
"font": {
"size": 10
}
}
},
"legend": {
"orientation": "h",
"x": 0,
"y": 2
},
"displayModeBar": false,
"margin": {
"l": 50,
"b": 45,
"t": 10,
"r": 10,
"pad": 4
}
};
config={
"scrollZoom": false,
"displayModeBar": true,
"editable": false,
"zooming": true,
"displaylogo": false,
"responsive": true
},
data=[ { "x": [], "y": [], "line": { "dash": "dot" }, "name": "Trace" }, { "x": [ "2025-03-28 03:45:00" ], "y": [ 1 ], "line": { "dash": "dot" }, "name": "X1 Leakage Current" } ]
,
Looking out for help here.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未指定源文件或测试。先复现所提供的 Plotly.js 布局和日期范围,然后跟踪相关的坐标轴刻度生成行为。完成标准是确定这些不一致的标签是否属于库缺陷;如果是,则添加一个有针对性的复现和回归测试。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100