Open dstollie opened 4 years ago
I am facing the same issue: Left is iOS, right is Android
That may be caused by number precision. x value is float in android and double in iOS.
So using unix timestamp as x may cause precision problem, there are some workarounds:
use other timeUnit, for example MINUTES, check config lib/AxisIface.js
timeUnit: PropTypes.oneOf(['MILLISECONDS', 'SECONDS', 'MINUTES', 'HOURS', 'DAYS']), // timeUnit of x,
You can also combine since, for example since = new Date('2020-01-01 00:00:00').getTime()
the final displayed date will be
since + x * timeUnit
After research the the lib, messing with all the configs and going through the issues on the github of MPAndroidChart I finally chose the make a bug issue here on this github:
The problem: As seen in the screenshot of "android" you can see that the distnace between the dots (circles) are not exactly the same. If you look at the example of iOS you can see that this is not the case and that the dots perfectly alight with each other. I cannot figure out why this is the issue. On the xAxis we use timestamp, this may be the issue but as far as I can see this should work. This issue might seem like a small bug but it makes the chart really confusing because if you look closely you expect a time difference between the points when there is actually no diff.
Expected Behavior
The dots on android do have the same dinstance between each other.
Actual Behavior
Graph in IOS
Graph On Android (faulty)
Screenshots
Data and config
Data:
Config:
Steps to Reproduce the Problem
Specifications