-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
ChartDataSet calcYValueSum() bug #604
Comments
Good catch! It smells like a bug, but I cannot find a proper fix since I found that it is (only?) used by pie chart, and speaking of angles in pie chart, negative values is supposed to be positive ones? @danielgindi what do you think? Any charts except pie chart is also using yValueSum? Should it be fabs all the time, or we need to remove fabs? There are other funcs such as |
LineChart also use |
which func in LineChart use yValueSum? Calculating yValueSum but not using it is harmless. I just found pie chart is using yValueSum |
As my title said, it's ChartDataSet's |
You can search who is using _yValueSum, not just calcYValueSum(). Not every chart will use it, even it is calculated. Otherwise people will find this bug earlier I suppose since abs() or not is quite different. |
I find this "bug" because I called |
Pie values should actually just not be negative. It's not valid. There's no good way to represent negative values in the pie chart (except maybe for going back in the other direction with a different width or color). Anyway I'm looking into the |
@PhilJay I can't find any reason for it being absolutized... Probably something historic but git's There's nothing using |
Yes, the |
@danielgindi how about pie chart? We don't abs the negative values any more? |
No we shouldn't. Pie charts should not contain negative values... And if they do - they definitely should not increase the total but render in a different way. |
I only encountered with test data or some mistaken input. I'm ok to let user abs it rather than us. |
I think that it also has another advantage - the user will immediately see that there's something wrong with his data, instead of seeing "correct" data and not being able to understand why it doesn't match another report... :-) |
notifyDataSetChanged()
will callcalcYValueSum()
Sum calculated from
addEntry()
andcalcYValueSum()
is not same, if value is negative. I thinkfabs()
is not needed.The text was updated successfully, but these errors were encountered: