echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] Pie chart roseType='area' incorrect when startAngle and endAngle given

Open MikkoSteerpath opened this issue 1 year ago • 1 comments

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=pie-roseType-simple&lang=ts&code=PYBwLglsB2AEC8sDeAoWsDOBTAThLGAXLANprrLkWxgCeIWxA5CPkwDRUUZgCGOYAILQA5gBtGsAIwAOAAztYXdFmgATYeMkBmAGwLlsAPRHYAWwjRNE4noPV0OYNgAq9SU35ZeHQ2t58xGQOFEiwAG68YgCuklJyCrDQvGYeABJRAGawgkywAL6cIehhkTGSAKyJyanMGWLZAEJ5hYYlEVGxxABMCYo16VmwAMIthgC6XPnkk_kA3EA

Steps to Reproduce

Create a roseType = 'area' chart and set startAngle and endAngle so that Math.abs(startAngle - endAngle) < Math.PI * 2. Add at least two items.

Current Behavior

Both the angles and radiuses of the pie chart's items are different.

Expected Behavior

Only the radius of the items should be different, each item should have the same angle. Here is what the graph should look like https://echarts.apache.org/examples/en/editor.html?c=pie-roseType-simple&lang=ts&code=PYBwLglsB2AEC8sDeAoWsDOBTAThLGAXLANprrLkWxgCeIWxA5CPkwDRUUZgCGOYAILQA5gBtGsAIwAOAAztYXdFmgATYeMkBmAGwLlsALYRomicT0Hq6HMGwAVepKb8svDobW8-xMjYokWAA3XjEAV0kpOQVYaF4jFwAJMIAzWEEmWABfTgD0INCIyQBWWPjE5hSxdIAhLNzDApCwyOIAJhjFCuS02ABhBsMAXS5s8lHsgG4gA

Environment

No response

Any additional comments?

A workaround is to set minAngle to be some large number like 360 in which case it seems the fixed angle is respected again. This technique was used to get the "expected behavior".

MikkoSteerpath avatar Feb 21 '24 17:02 MikkoSteerpath

Both the angles and radiuses of the pie chart's items are different. Only the radius of the items should be different, each item should have the same angle.

Agree. And I'll throw a guess that roseType:'area' is not even implemented. It behaves exactly like roseType:'radius' before being fixed by minAngle. BTW in order to work minAngle needs to be (minAngle >= total angle / total sectors) - Demo Code

image

helgasoft avatar Feb 21 '24 23:02 helgasoft