Describe the bug / 问题描述
Version: @ant-design/plots 2.6.8 (migrated from 1.2.6)
Environment: React 18
Description:
After upgrading from v1 (1.2.6) to v2 (2.6.8), the Pie chart's outer label layout breaks when there is one dominant slice and many small slices. Labels for the small slices stack on top of each other, overlap, and become completely unreadable. This worked correctly in v1.
Reproduction:
import { Pie } from '@ant-design/plots';
import React from 'react';
import { createRoot } from 'react-dom/client';
const DemoPie = () => {
const data = Array.from({ length: 50 }, (_, i) => ({
type: `test ${i + 1}`,
value: i === 1 ? 11000 : i + 1,
}))
const config = {
padding: 80,
data: data,
angleField: 'value',
colorField: 'type',
label: {
text: 'value',
position: 'outside',
transform: [{ type: 'overlapHide' }]
},
legend: {
color: {
title: false,
position: 'right',
rowPadding: 5,
},
},
};
return <Pie {...config} />;
};
createRoot(document.getElementById('container')).render(<DemoPie />);
Expected behavior:
Labels should either auto-adjust spacing to avoid overlap, hide when space is insufficient, or provide a readable layout — as they did in v1.
Actual behavior:
All 50 outer labels render on top of each other around the small-slice side of the pie, making them completely illegible (see screenshot).
I already checked and tried all transforms and diff position https://ant-design-charts.antgroup.com/options/plots/label#transform
Screenshot:
v1 screenshot
Reproduction link / 复现链接
https://codesandbox.io/p/sandbox/9p88s4
Please try the above code snippet
Steps to Reproduce the Bug or Issue / 重现步骤
v1 https://ant-design-charts-v1.antgroup.com/en/examples/pie/basic/#outer-label
v2 https://ant-design-charts.antgroup.com/en/examples/statistics/pie/#outer-label
Version / 版本
2.6.8
OS / 操作系统
Browser / 浏览器
Describe the bug / 问题描述
Version: @ant-design/plots 2.6.8 (migrated from 1.2.6)
Environment: React 18
Description:
After upgrading from v1 (1.2.6) to v2 (2.6.8), the Pie chart's outer label layout breaks when there is one dominant slice and many small slices. Labels for the small slices stack on top of each other, overlap, and become completely unreadable. This worked correctly in v1.
Reproduction:
Expected behavior:
Labels should either auto-adjust spacing to avoid overlap, hide when space is insufficient, or provide a readable layout — as they did in v1.
Actual behavior:
All 50 outer labels render on top of each other around the small-slice side of the pie, making them completely illegible (see screenshot).
I already checked and tried all transforms and diff position https://ant-design-charts.antgroup.com/options/plots/label#transform
Screenshot:
v1 screenshot
Reproduction link / 复现链接
https://codesandbox.io/p/sandbox/9p88s4
Please try the above code snippet
Steps to Reproduce the Bug or Issue / 重现步骤
v1 https://ant-design-charts-v1.antgroup.com/en/examples/pie/basic/#outer-label
v2 https://ant-design-charts.antgroup.com/en/examples/statistics/pie/#outer-label
Version / 版本
2.6.8
OS / 操作系统
Browser / 浏览器