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
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
Any additional comments?
No response