antvis / antvis/F2

PieLabel 样式自定义——label居中

Open
#1,166 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
8k
Forks
637
PR merge metrics
No merged PRs in 30d

Description

- [x] I have searched the [issues](https://github.com/antvis/f2/issues) of this repository and believe that this is not a duplicate.

### What problem does this feature solve?
业务上对于饼图有特殊的 UI 定制,需要将 label 文本居中在 PieLabel 指示线末端,试了一下调整单个 label1 / label2 的 offsetY,指示线会和文本重叠并且覆盖在文本上方。请问对于这样的 UI 场景,有什么调整的方法吗?

期望结果:![PieLabel 效果图](https://p1.dailygn.com/tos-cn-i-8vc7tlzf3c/ba99266165044866bc742999d0c0b613~tplv-8vc7tlzf3c-raw.png)

### What does the proposed API look like?
like...
```javascript
chart.PieLabel({
style: 'center'
})
```
?

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by locating the PieLabel implementation and its label1/label2 offset handling, then compare the requested centered-at-line-end appearance with the linked image. Done means the API and resulting label behavior are defined clearly enough to validate.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.