echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] Label disappear in emphasis state when Pie sets "minShowLabelAngle" property

Open kayla3love opened this issue 1 year ago • 4 comments

Version

5.5.0

Link to Minimal Reproduction

https://codesandbox.io/s/vfdn23

Steps to Reproduce

1、Wait for all setTimeout functions to complete execution. 2、Move the mouse over the blue sector to enter the highlight state. 3、Both the label and labelLine of the blue sector disappear. 4、Move the mouse out of the blue sector, and the label and labelLine return to normal.

Current Behavior

Now dynamically update the dataset of the pie chart, changing Series A's value from Value1 to Value2, and then back to Value1.

1、If the minShowLabelAngle property is not set, everything runs normally. 2、If set minShowLabelAngle property, and the sector angle corresponding to Value1 > minShowLabelAngle while the sector angle corresponding to Value2 < minShowLabelAngle, then after the value of Series A is restored to Value1, the label and labelLine of the corresponding sector in highlight state will disappear image

Possible Reason

When value changes to Value2,label.ignore and label.emphasis.ignore is true

image

When value back to Value1,ignore is false but emphasis.ignore is true

image

Expected Behavior

When value back to Value1,label and labelLine appear in in highlight state

Environment

- OS: macOS Ventura 13.4
- Browser: Chrome 121.0.6167.184

Any additional comments?

No response

kayla3love avatar Feb 20 '24 12:02 kayla3love

API for minShowLabelAngle says "If a sector is less than this angle (0 ~ 360), label and labelLine will not be displayed." Your minShowLabelAngle is 10 and therefore the value of 0 does not show up. 📌 please close issue if problem solved.

helgasoft avatar Feb 20 '24 17:02 helgasoft

API for minShowLabelAngle says "If a sector is less than this angle (0 ~ 360), label and labelLine will not be displayed." Your minShowLabelAngle is 10 and therefore the value of 0 does not show up. 📌 please close issue if problem solved.

@helgasoft In Demo,Value then changes from 0 to 180,180deg is larger than minShowLargeAngle,but label disappears in emphasis state,appears in normal state

kayla3love avatar Feb 21 '24 00:02 kayla3love

ok, I see it now, you are right - emphasis label is missing even though it should show up in accordance with the new data. demo - blue sector label missing on hover.

helgasoft avatar Feb 21 '24 02:02 helgasoft

Possible Reason

When value changes to Value2,label.ignore and label.emphasis.ignore is true

image

When value back to Value1,ignore is false but emphasis.ignore is true

image

@helgasoft Possible problems:

if(stateShow !== showNormal){
  stateObj.ignore = !stateShow
}

kayla3love avatar Feb 21 '24 03:02 kayla3love