Skip to content

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

Description

@smuki

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions