MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

Problem of "setGranularity for 60f"

Open simonlau0715 opened this issue 8 years ago • 3 comments

I try to setGranularity(60f) but the result is not my expectation. (XAxis should be 60, 120, 180...) 2017-07-03 10 01 44

And I check setGranularity(50f), setGranularity(40f) and setGranularity(30f) is correct. 2017-07-03 10 07 33 2017-07-03 10 06 46 2017-07-03 10 08 25

And I need to use 60f, and then convert them in HH:mm format.

(P.S. I am tried the Visible X Range is 180 to 180, 240 to 240 and 360 to 360 on 60f. It still is (100, 200 ...))

Do they have a secret rules on X-Axis?

Thanks a lot.

simonlau0715 avatar Jul 03 '17 14:07 simonlau0715

I have the exact same issue but with yAxis. If I set the Granularity to 60f the first labels are at 100 but if I set the Granularity to 30, 40 or 50 the first label is at the correct position. @simonlau0715 did you solve it? @PhilJay any clue ?

adriamt avatar Sep 26 '17 09:09 adriamt

Did you guys find any solution to the problem? I'm running into exact same problem when setting granularity above 5 it automatically makes it 10? @PhilJay Any idea why this might be happening? I'm trying to set granularity to 6 and it makes it 10 every time

humayoun7 avatar Apr 03 '20 01:04 humayoun7

I had the same problem, and it worked when I commented out this code --> AxisRenderer.java-->computeAxisValues(float min, float max) 企业微信截图_17182646348339

liqiaotong avatar Jun 13 '24 07:06 liqiaotong