antvis/G6

官网示例,Text超长文本,在某些文本下有问题 #4779

donghuizhou posted onGitHub

问题描述

官网Text超长文本示例

如下图,我把节点的label改为 This11111111111111 后,图上label内容超过了节点区域,这如何解决

image

重现链接

https://github.com/antvis/G6/assets/31002949/6fb28085-4e02-4e66-9fa4-8a325234370d

重现步骤

如上问题描述

预期行为

在我如上节点label下,图上内容不超过节点区域

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


我这里没有复现,可能和浏览器默认字体有关,可以配置 labelCfg 中的 style 中的字体

font: 'normal normal normal 12px "PingFang SC"', fontFamily: '"PingFang SC"'

posted by Yanyan-Wang over 1 year ago

我这里没有复现,可能和浏览器默认字体有关,可以配置 labelCfg 中的 style 中的字体

font: 'normal normal normal 12px "PingFang SC"', fontFamily: '"PingFang SC"'

image 没生效

posted by donghuizhou over 1 year ago

使用 G6 5.0,通过配置 labelWordWrapWidth 可以规避该问题

posted by Aarebecca 11 months ago

Fund this Issue

$0.00
Funded

Pull requests