antvis/G6

内置combo的labelCfg表现和node/edge的不同 #4962

CheyenneRowe posted onGitHub

问题描述

1.根据实例,设置节点或边的label背景,如下图: <img width="250" alt="image" src="https://github.com/antvis/G6/assets/18679459/f68bec03-e6fb-4801-a427-61ac1529d9f3">

defaultEdge: { labelCfg: { autoRotate: true, style: { fill: '#1890ff', fontSize: 14, background: { fill: '#ffffff', stroke: '#ffffff', padding: [10, 10, 10, 10], radius: 2, }, }, }, }, 同样的配置在combo上设置没有生效,只有颜色生效了 <img width="288" alt="image" src="https://github.com/antvis/G6/assets/18679459/5ed222b7-64ef-4763-8fdd-60bbe8ae4dc2">

  1. rect类型的combo在设置了文字位置为top时,如何设置居中?

    <img width="215" alt="image" src="https://github.com/antvis/G6/assets/18679459/cba2c4c2-06f3-4af7-a654-c58681bd1dc4">

labelCfg: { position: 'top', refY:-10, style: {...} }

重现链接

https://codesandbox.io/s/dv2ndj?file=/index.js:1442-1468

重现步骤

见上

预期行为

期望跟node或者edge对于labelCfg的配置一致

平台

  • 操作系统: [macOS, ]
  • 网页浏览器: [Google Chrome,]
  • G6 版本: [4.5.1 ... ]

屏幕截图或视频(可选)

<img width="237" alt="image" src="https://github.com/antvis/G6/assets/18679459/a8eeb8b5-167e-46ec-8713-6d1ae8e69107"> <img width="288" alt="image" src="https://github.com/antvis/G6/assets/18679459/0bed1d07-60af-48c4-9e6a-2f38fb6f1f9f">

补充说明(可选)

No response


combo 目前不支持 background。可以配置 labelCfg.style 的 stroke 为 #fff,lineWidth 为 2 这样给个白色描边替代这个效果。

posted by Yanyan-Wang over 1 year ago

This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.

这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] 10 months ago

Fund this Issue

$0.00
Funded

Pull requests