lecho / hellocharts-android

Charts library for Android compatible with API 8+, several chart types with scaling, scrolling and animations πŸ“Š
Apache License 2.0
7.43k stars 1.61k forks source link

Problems with equal values ​​on the y axis #534

Open GydeonMarques opened 5 years ago

GydeonMarques commented 5 years ago

Hello ... I don't know if it's a problem, but when I have equal Y-axis values ​​on my line chart, it just doesn't show anything on the chart. See example below

List values = new ArrayList(); values.add(new PointValue(0, 2)); values.add(new PointValue(1, 2)); values.add(new PointValue(2, 2)); values.add(new PointValue(3, 2));

onecoders commented 5 years ago

Same problem

dajver commented 4 years ago

yep, have same problem, do we have any solumtion @lecho ?

It's seems that here https://github.com/lecho/hellocharts-android/issues/455 it was fixed by @uCloudCastle, but for me it doesn't work, seems that problem is because of decimals...

lecho commented 4 years ago

Hi guys, it's been a while since I was active in this repo. I believe the problem is related to the "feature" that this library calculates viewport automatically(min and max for both axis). When all points have the same value min and max are the same and thereby viewport has height/width of 0. It can be disabled and set manually. For solution, please take a look at issue #169 and #143

dajver commented 4 years ago

Hi, thank for your response, but this issue has been fixed here https://github.com/lecho/hellocharts-android/issues/455.