[Bug] Pie chart setting moveOverlap, when all data is 0, the label undergoes a positional shift
- Dominant language
- TypeScript
- Stars
- 67.3k
- Forks
- 19.8k
- Avg merge
- 11d 14h
- Merged PRs (30d)
- 8
Description
### Version
5.4.3
### Link to Minimal Reproduction
https://echarts.apache.org/examples/zh/editor.html?code=PYBwLglsB2AEC8sDeAoWtJgDYFMBcya6GOAHmAQOQBKOAZjgE5OzB2wCGsA6jgEYBnCGByUANEXQCArnxHkqAMQ4BrHLAAiHMB3GTYuOhViUAxjmgjGlIgF8J6MMGBZIIAqmIZGEAOa-mKmEcAFsbdHsiXADoABMPfWAfC2NKADcmSFMOLD0vQ1SC8NhIqSYIHAECAG19Ty9YaA4Q_BMAQVNzAQFYRUZgMIcGsABPEFbKEAq8hsYOWIhpKpMAVgAGAFIZr1jtDhr9LyRYNJzpVrWxRuaJgGUcDkZTAAtYAFFoXwhoURKhhuQJzOFyuTRaVA0EGYpjAlD-h2Ix1OWHOBEu13BJjeIQ4EFy8IB6CRwLRoJuVAAqtAoHA2rEBHDbAiALr_YhYDh8HBYAAyHBGwGkxnqAJCwAyAHkMowOe4TAJnhAjABNYpeUoNDlcrAJQmwBXAADuBDAjHObK8IGAQkgMCC0CEsVEFuIdCSOLAVioSFMtm2DTdlluEAAXq0AIwANgRGq8oRAzw4QmWIoawRCt1GuF1ev1idiRoAQijGARw5cEV4FfMjRK6HQBDgwAANUmV4jVguGgDCLiSVEYvj4HAAFOjx1c1gA6FYASjVDSZAKXxBXzJQtgA3EA
### Steps to Reproduce
```javascript
option = {
title: {
text: 'Referer of a Website',
subtext: 'Fake Data',
left: 'center'
},
tooltip: {
trigger: 'item'
},
legend: {
orient: 'vertical',
left: 'left'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: '50%',
data: [
{ value: 0, name: 'Search Engine' },
{ value: 0, name: 'Direct' },
{ value: 0, name: 'Email' },
{ value: 0, name: 'Union Ads' }
],
labelLayout: {
moveOverlap: 'shiftY'
},
label: {
show: true,
position: 'inside',
formatter: '{c}',
fontSize: 16
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
```
### Current Behavior
Label offset
### Expected Behavior
Label alignment
### Environment
```markdown
- OS:
- Browser:
- Framework:
```
### Any additional comments?
_No response_
Contributor guide
Research direction
Start with the linked minimal reproduction and inspect pie-chart labelLayout handling for moveOverlap set to 'shiftY' when every data value is zero. Compare the current label positions with the expected alignment in the reproduction; done means the labels remain aligned without the positional shift.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100