antvis/G2

support limitInShape label transform #4254

visiky posted onGitHub

使用方式

labels: [{
    text: 'xxx',
    transform: [{ type: 'limitInShape' }]
}]

预览效果

<img width="739" alt="image" src="https://user-images.githubusercontent.com/15646325/200511469-9e0e5d9d-5e05-4acc-9e6d-7bda90db8bbd.png">


另外,还可以考虑 adjustColor 根据 label 和其背景色的颜色对比度情况,进行自动调整

posted by visiky over 2 years ago

@visiky limitInPlot 就是期望如果图形放不下就省略吗?

posted by hustcc over 2 years ago

已经有了,见文档:

posted by hustcc over 2 years ago

Fund this Issue

$0.00
Funded

Pull requests