Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 半环形图(饼图),多项为0时,显示的不为一个半环形了。 #18732

Closed
sober-bruce opened this issue Jun 8, 2023 · 3 comments · Fixed by #18820
Closed

Comments

@sober-bruce
Copy link

Version

5.4.2

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=pie-half-donut

Steps to Reproduce

1、官方实现半环形图,是在最后插入了一条数据(该条数据的value是前面所有项的总和,并把它的color设置成none),这样子就只显示了前面的项,实现了展示半环形的效果。
2、但是如果前面的项大于1个,并且value都为0,这样就会导致最后一项的value也是0;最后一项就不会占50%了。

Current Behavior

1、当项超过1且每项都为0时候,不会展示成半环形状态。

Expected Behavior

1、当项超过1且每项都为0时候,展示成半环形状态。

Environment

- OS: Windows 10
- Browser:Chrome 113.0.5672.129
- Framework: [email protected]

Any additional comments?

No response

@sober-bruce sober-bruce added the bug label Jun 8, 2023
@echarts-bot echarts-bot bot added the pending We are not sure about whether this is a bug/new feature. label Jun 8, 2023
@echarts-bot
Copy link

echarts-bot bot commented Jun 8, 2023

@sober-bruce It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Bug] In the semi-circular chart (pie chart), when the number of items is 0, the display is no longer a semi-circular chart.

BODY

Version

5.4.2

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=pie-half-donut

Steps to Reproduce

  1. The official implementation of the semi-circular chart is to insert a piece of data at the end (the value of the data is the sum of all the previous items, and its color is set to none), so that only the previous items are displayed, realizing the effect of displaying the semi-ring.
  2. However, if the previous item is greater than 1, and the value is 0, this will cause the value of the last item to be also 0; The last item will not account for 50%.

Current Behavior

  1. When the item exceeds 1 and each item is 0, it will not be displayed in a semi-circular state.

Expected Behavior

  1. When the item exceeds 1 and each item is 0, it is displayed in a semi-circular state.

Environment

- OS: Windows 10
- Browser:Chrome 113.0.5672.129
- Framework: [email protected]

Any additional comments?

No response

@sober-bruce
Copy link
Author

配置文件信息是:
option = {
series: [
{
type: 'pie',
radius: ['40%', '70%'],
center: ['50%', '55%'],
startAngle: 180,
data: [
{ value: 0, name: 'Search Engine' },
{ value: 0, name: 'Direct' },
{
value: 0,
itemStyle: {
color: 'none',
decal: {
symbol: 'none'
}
},
label: {
show: false
}
}
]
}
]
};

MingYang-Yin pushed a commit to MingYang-Yin/echarts that referenced this issue Jun 9, 2023
@plainheart plainheart added website topic: pie and removed bug pending We are not sure about whether this is a bug/new feature. labels Jun 9, 2023
@sober-bruce
Copy link
Author

老哥厉害~~
如果总和为0,就在后面插入n个color为none的项就行(n为数据项个数)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants