antvis/G2

Do you want to work on this issue?

You can request for a bounty in order to promote it!

图例文字较长时文字被截断 #6302

chenluli posted onGitHub

问题描述

如图所示,图例文字较长时,字会被截断,展示不全。 <img width="1074" alt="Screenshot 2024-06-20 at 11 43 58" src="https://github.com/antvis/G2/assets/16997933/6b010cad-e910-4883-80ba-d9b26274bf0c">

任意图例名称较长时可复现,例如 'order_count', 'total_sales',可复现 spec 如下

chart.options({
  type: 'interval',
  data: [
    {name: 'total_sales', month: 'May', number: 10},
    {name: 'total_sales', month: 'Apr', number: 20},
    {name: 'order_count',  month: 'May', number: 20},
    {name: 'order_count',  month: 'Apr', number: 30}
  ],
  encode: {
    x: 'month',
    y: 'number',
    color: 'name'
  },
  transform: [{ type: 'stackY' }]
})

重现链接

No response

重现步骤

No response

预期行为

期望能完整展示

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests