Closed lascyb closed 2 weeks ago
@lascyb 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. 🤗
我在 #15095 中,看到了一些这方面的更改,但是标题写的是 - 令饼图支持负值,结果却是直接筛选去除了负值
你好 @helgasoft ,感谢回复
data = [10,-10]
的时候,在用户没有明确设置删除负值的情况下,echarts不应该粗暴的删除数据中的-10不知道我描述的您是否可以理解 (ps.其实就是,不支持负值就直接报错吧,不要动用户的数据T_T)
@lascyb Negative values are not expected in Pie charts because it's meaningless to have negative pie pieces so it's natural to be filtered. If not, the total value could be not as expected. ECharts filters invalid data so that the rest can be displayed. There is no reason to print an error log and renders nothing when there is a negative value. You should be responsible for your input to make sure it's valid all the time. Otherwise, there is possibility that you get expected result with valid input before your presentation and then when in presentation, the data dynamically changed and have negative ones.
@Ovilia 文档中没有任何地方提示过负值会被过滤,这种没有任何提示且不经过用户设置就直接过滤用户数据进行渲染的行为我觉得很无语
或许含有负数的饼图毫无意义,但是总有些数据会含有负数,这个控制权应该交给用户,而不是让觉得负数无意义就把它自行删除
有没有个什么东西可以发起个投票
As I explained, this is the universal behavior of ECharts. If you feel otherwise, you may make a pull request and let's discuss about it later.
Version
5.5.1
Link to Minimal Reproduction
https://codesandbox.io/p/devbox/kz4yvk
Steps to Reproduce
所有的值只要是负数就会存在
Current Behavior
我司财务报表中中存在部分负利润,但是在饼图展示时直接被隐藏,这是无法接受的结果
Expected Behavior
它可以报错,也可以令图表直接不显示,我可以人工处理含负值的数据,但是不能在没有任何提示的情况下直接筛选去除我数据中存在的负值
Environment
Any additional comments?
No response