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] pie 的 data 数据都为 0 时,百分比为 undefined #17787

Closed
SaberA1ter opened this issue Oct 19, 2022 · 4 comments
Closed

[Bug] pie 的 data 数据都为 0 时,百分比为 undefined #17787

SaberA1ter opened this issue Oct 19, 2022 · 4 comments

Comments

@SaberA1ter
Copy link

Version

5.4.0

Link to Minimal Reproduction

https://codesandbox.io/s/clever-proskuriakova-0x5os5?file=/src/App.js

Steps to Reproduce

只需要使 data 数据皆为 0 并显示百分比即可

Current Behavior

显示为 {d} 或者 ({ percent }) 都为 undefined

Expected Behavior

在 5.3.3 版本中,如果数据都为 0 的情况下则应该显示为 0%

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@SaberA1ter SaberA1ter added the bug label Oct 19, 2022
@echarts-bot echarts-bot bot added the pending We are not sure about whether this is a bug/new feature. label Oct 19, 2022
@echarts-bot
Copy link

echarts-bot bot commented Oct 19, 2022

@SaberA1ter 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] When the data of pie is all 0, the percentage is undefined

BODY

Version

5.4.0

Link to Minimal Reproduction

https://codesandbox.io/s/clever-proskuriakova-0x5os5?file=/src/App.js

Steps to Reproduce

Just make the data data all 0 and display the percentage

Current Behavior

displayed as {d} or ({ percent }) both are undefined

Expected Behavior

In version 5.3.3, if the data is all 0, it should be displayed as 0%

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@Ovilia
Copy link
Contributor

Ovilia commented Oct 19, 2022

在数学上 0 除以 0 的结果是未定义的,所以得到 undefined 没有问题。如果需要变成 0 的话,自己在 formatter 里转即可

@plainheart
Copy link
Member

@Ovilia @SaberA1ter 抱歉,这其实 5.4.0 版本因饼图性能优化 #17275 导致的一个 bug,已在 #17734 中一并修复。

@plainheart plainheart added topic: pie and removed pending We are not sure about whether this is a bug/new feature. labels Oct 19, 2022
@SaberA1ter
Copy link
Author

在数学上 0 除以 0 的结果是未定义的,所以得到 undefined 没有问题。如果需要变成 0 的话,自己在 formatter 里转即可

因为新旧版本表现不一样,翻了更新日志也没有看到关于这点的特别说明,所以就提了这个 issue

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

No branches or pull requests

3 participants