plotly / plotly/plotly.js

Y-axis changes to hoverformat value when both tickformat and hoverformat are set

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

还没有人认领这个 Issue。

bug P3
主要语言
JavaScript
星标
18.3k
派生
2k
平均合并
2 天 12 小时
30 天内合并 PR
28

描述

When using Plotly.js, if both tickformat and hoverformat are specified for the y-axis, the y-axis values unexpectedly change to the hoverformat values instead of displaying the tickformat values.

example code:

    yaxis2: {
        title: { text: 'Strip Widht [mm]' }, // Y-axis title
        titlefont: { color: '#004768', size: 8, standoff: 0.1 },
        tickfont: { color: '#004768', size: 8 },
        domain: [0.15, 0.80],
        linecolor: '#004768',
        // range based on strip width setpoint + tollerance + 10 mm extra
        range: [(tagValues[4] - tagValues[3] - 5), (tagValues[4] + tagValues[3] + 5)],
        tickvals: [(tagValues[4] - tagValues[3] - 3),(tagValues[4] - tagValues[3]), tagValues[4], (tagValues[4] + tagValues[3]), (tagValues[4] + tagValues[3] + 3)],
        hoverformat: '.2f',
        tickformat: '.0f',
        zeroline: false
    },

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先使用提供的 yaxis2 配置重现该问题,同时保留 tickformat: '.0f' 和 hoverformat: '.2f' 的设置。跟踪坐标轴如何渲染刻度标签和悬停标签,然后验证刻度使用 tickformat,而悬停值保留 hoverformat。

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

评估

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

把新 issue 发到你的邮箱

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