VisActor / VisActor/VChart

[Bug] 饼图,无法根据条件划线,如图

Open
#4,605 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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都是乱的

Image

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.