Open eakteam opened 5 years ago
Can you please give the code that causes this, as I really can't tell what's happened to cause count
to be negative. Basically, the max
value in your data is actually smaller than the min
, causing it to be negative.
I'm certain this isn't the fault of the library, but rather you have done something out of order. Please create a gist of the code that is called before your chart is drawn.
I clearly understand that on your side. But on my side the code is really to long and can't be shared here to understand the logic. But i wonder if this can be solved with a try-catch in the library, because in fact this issue doesn't make any weird change in the chart view but just crash the app. So if this is possible i think will be more easy to just solve for the moment
Understandable, and I agree that this library needs more redundancy checks to reduce this sort of stuff from happening, as right now it's kinda fragile.
Thank you for your support ! This is sometime more important than a bug. Waiting for sulution.
You need to ensure your datas to show are in order or they may cause this issue.
Does anyone know if this bug is fixed?
I solved this bug like this way. The reason of this issue is on data when you are adding. I added the data as reversed because I wanted to use this graph as timeline, which means adding data.add(x, y) as x.reversed order. ex: data.add(Entry(3, 100) data.add(Entry(2, 50) data.add(Entry(1, 150)
It causes the bug because the parameter of the 'x' is up to reversed order By sorting 'x' as ascending order, issue solved ex: data.add(Entry(1, 150) data.add(Entry(2, 50) data.add(Entry(3, 100)
There's no way if this solution doesn't work at all.
Sorry for my bad English :)
look this library MPFreeChart
Version 3.1.0 pre-release