[Bug] Cannot reduce legend line-height in Firefox

未关闭
#21,647 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
typescript

调研方向

从链接的最小复现开始,使用所述的 itemHeight、lineHeight 和 fontSize 值比较 Firefox 和 Chromium 中的图例布局。检查图例文本元素和路径元素的 SVG transform 值。当 Firefox 产生与 Chromium 相同的多行图例间距和布局时,即视为完成。

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

描述

bug en pending
Version

6.1.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=area-stack&code=xVVNj5swEL3vrxipBy45BNikgaqHaLv9OFSqlG17qPYwCROwChgZsxta5b93xgTYJFKkSiuFA9jjmfG898ZGV1bpEt7D3xsAq2xOsRvyhHY2Bm9lcfObElgaQrjL0FiPl_cTcdc6t6oaAoxKUzIcgztVe-IBIMNvWpVWFjo_9mwr3sbbGF33fgA5rikffQDWvHFqdFMmdzrXkvfNHN9Gi5kUIM_efeXtykmNSvr4nLZc_HzaJefCMp7ODtO1tlYXMfihM7jgnFIqh_AELcbwy7svUOXeBLzvpbC0TLhc8H6ohHQ_-aAMbayMVoRmk8F9maqSvMdur2eV2CyGoN9bWSo-U1fPfNhduF7ZdiQ_5xS9m38I3erSrtQf9lmMgSzBWu_6sC2hbcyQBaDGJ1rWXwpMxXhC2G7J4jBMZz3VBi2l2rSDPGsRAk37CVnwLeY19Ss9WV91KTQ8NCSfn5S4WdbI56NRjiLsmGpK73GoxTHVXqjlCXPOeexfk1F0FlBiIQEH2Y6zCKWDrZauZuODtjh6Ivd4L4NjSB4qqgxrKW5sza3eNGzwuiqGfjxhxA-mE26ygF9TX0a3E4jYFHDfQeBPDxR0UScQXjTctWEEDsZCYEQMIxAYgeAIBUd4GceLs3J1OfgMcvWMI3ByzBiHP-C4vYyjP-bXBhGKGKGACAVEKGKEoxjBRRDHN9T_Yzm7outMP8d88TfDZQBQ6VrJP4Wjra7OcLwyHwvhIxI-IuEjEj58152-Y4SPX0-JXB03-3f_AA&enc=deflate

Steps to Reproduce
  1. Set legend.itemHeight to a small value (6)
  2. Set textStyle.lineHeight to 10px
  3. Set textStyle.fontSize to 8.
  4. The legend needs a lot of label to be on multiple lines (or the legend width could be limited)
  5. Use default font
Current Behavior

It looks like the distance between the 2 legend lines is equal to lineHeight + 8px on both browsers (Firefox and Chromium).
In Chromium, with the provided example, the distance between the 2 lines is 18px as expected.
But, the legend line height in Firefox cannot be reduced under 20px + 8px.
It looks like that the computed transform="translate(...)" attribute for each text and path element of the legend is not "valid" in Firefox.

Expected Behavior

Firefox should have the same layout that Chromium.

Environment
- OS: Arch Linux
- Browser: Firefox 151
- Framework: None
Any additional comments?

No response

主要语言
TypeScript
星标
67.7k
派生
19.9k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

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

apache/echarts 的其他 Issue

查看 apache/echarts 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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