asdjqw opened a new issue, #21882: URL: https://github.com/apache/echarts/issues/21882
### Version 6.1.0 ### Link to Minimal Reproduction https://echarts.apache.org/examples/en/editor.html?c=pie-simple&version=6.1.0&renderer=svg&enc=base64&code=b3B0aW9uID0gewogIGFuaW1hdGlvbjogZmFsc2UsCiAgc2VyaWVzOiBbewogICAgdHlwZTogJ3BpZScsCiAgICBsYWJlbDogeyBzaG93OiB0cnVlLCBmb3JtYXR0ZXI6ICd7Yn06IHtkfSUnIH0sCiAgICBkYXRhOiBbeyBuYW1lOiAnQScsIHZhbHVlOiAxZTMwOCB9LCB7IG5hbWU6ICdCJywgdmFsdWU6IDFlMzA4IH1dCiAgfV0KfTs%3D ### Steps to Reproduce 1. Open the minimal reproduction link above. It loads the example code and was verified with ECharts 6.1.0. 2. Run this option: ~~~~js option = { animation: false, series: [{ type: 'pie', label: { show: true, formatter: '{b}: {d}%' }, data: [{ name: 'A', value: 1e308 }, { name: 'B', value: 1e308 }] }] }; ~~~~ 3. The chart shows A: 100% and B: 0%, and the two normal half-circle slices are missing. 4. Change both values from 1e308 to 1 and run it again. The chart now shows two normal 50% slices. ### Current Behavior The two values are equal, but their percentages are [100,0]. Both calculated slice angles are 0. ### Expected Behavior Equal values should have equal shares: 50% each, with two half-circle slices. 1e308 is a finite JavaScript number, although it is very large. If this size is not supported, the chart should report that clearly rather than silently showing the wrong percentages. ### Environment ```markdown - OS: Windows 11 - Browser: Edge 158.0.4370.45, tested with Canvas and SVG - Framework: none - Also reproduced with Node.js 24.18.0 and SVG SSR ``` ### Any additional comments? Each value is finite, but adding the two values produces Infinity. The percentage and angle calculations then use this overflowing sum. This appears to explain both the wrong labels and the missing slices. The same wrong percentages are passed to the public label.formatter callback, so the problem is not limited to the '{d}%' template. [1,1], [1e16,1e16] and [8e307,8e307] work correctly; [1e308,1e308] does not. This is an extreme-number test. It uses only local numbers, without remote data. The recorded searches did not find a fix for this specific sum-overflow case. The inspected master was 34f4d927eafe251f26f63afd3aeefa30f2feba30. AI assistance: Codex helped prepare the local tests and this report. The observations came from actual local execution. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
