antvis/G6

text不能设置文本宽度 #4992

wangweiq59 posted onGitHub

Describe the bug

为什么addShape一个text不能设置文本宽度呢,这样容易导致内容超出 另外,画布整体背景的api是哪个呢

Your Example Website or App

为什么addShape一个text不能设置文本宽度呢,这样容易导致内容超出 另外,画布整体背景的api是哪个呢

Steps to Reproduce the Bug or Issue

为什么addShape一个text不能设置文本宽度呢,这样容易导致内容超出 另外,画布整体背景的api是哪个呢

Expected behavior

为什么addShape一个text不能设置文本宽度呢,这样容易导致内容超出 另外,画布整体背景的api是哪个呢

Screenshots or Videos

No response

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1] 为什么addShape一个text不能设置文本宽度呢,这样容易导致内容超出 另外,画布整体背景的api是哪个呢

Additional context

No response


啥意思,你是想要做自动缩略么?v4 参考这个做法: https://g6.antv.antgroup.com/examples/item/label/#labelLen

v5 可以设置 maxWidth 了,但 v5 还在 beta 阶段:https://g6-next.antv.antgroup.com/examples/item/label/#labelLen

画布整体背景想设置成什么样子?可以去改 canvas dom 的 css

posted by Yanyan-Wang over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests