-
Notifications
You must be signed in to change notification settings - Fork 19.7k
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
Comments
@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. 🤗 TRANSLATEDTITLE [Bug] When the data of pie is all 0, the percentage is undefined BODY Version5.4.0 Link to Minimal Reproductionhttps://codesandbox.io/s/clever-proskuriakova-0x5os5?file=/src/App.js Steps to ReproduceJust make the data data all 0 and display the percentage Current Behaviordisplayed as {d} or ({ percent }) both are undefined Expected BehaviorIn 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 |
在数学上 0 除以 0 的结果是未定义的,所以得到 undefined 没有问题。如果需要变成 0 的话,自己在 formatter 里转即可 |
@Ovilia @SaberA1ter 抱歉,这其实 5.4.0 版本因饼图性能优化 #17275 导致的一个 bug,已在 #17734 中一并修复。 |
因为新旧版本表现不一样,翻了更新日志也没有看到关于这点的特别说明,所以就提了这个 issue |
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
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: