[Bug] 饼图,无法根据条件划线,如图
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.8k
- Forks
- 221
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 26
Description
Version
2.1.1
Link to Minimal Reproduction
pichart
Steps to Reproduce
饼图,期望通过占比觉得显示或者不显示label,不显示label的也不要划线,但并不成功,而且会导致是否显示label都是乱的
pieSpec.label = {
visible: true,
formatMethod: (label: string, data: any) => {
const percent = totalValue !== 0 ? (data.v1 / totalValue) * 100 : 0;
if (percent < 1) {
return {
type: 'rich',
text: [
{
text: \n \n,
fill: 'rgba(0, 0, 0, 0.92)',
fontSize: 11,
fontWeight: 600,
},
],
};
}
const formattedPercent = formatNumber(percent);
return {
type: 'rich',
text: [
{
text: ${label} (${formattedPercent}%)\n,
fill: 'rgba(0, 0, 0, 0.92)',
fontSize: percent < 1 ? 0 : 11,
},
],
};
},
Current Behavior
饼图,期望通过占比觉得显示或者不显示label,不显示label的也不要划线,但并不成功,而且会导致是否显示label都是乱的
Expected Behavior
饼图,期望通过占比觉得显示或者不显示label,不显示label的也不要划线,但并不成功,而且会导致是否显示label都是乱的
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report provides the pichart reproduction and a pieSpec.label.formatMethod snippet; start by running that reproduction with VChart 2.1.1 and inspecting pie-label behavior. Done means percentage-based label visibility is consistent, and hidden labels do not produce leader lines.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100