-
-
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
Zooming LineChart x axis on 32bit processor doesn't work as expected #1679
Comments
I've figured out, that this may happen cause of CGFloat is float on 32bit devices, and double on 64bit. Is it possible to somehow force CGFloat to be double even on 32bit device? |
It should not matter whether it's double or float with your data, though I don't fully understand why you say it. |
reopen if you give more information and details. |
@Fahrenheit-sp a few points:
|
Is this the value where the overlap happens in your screenshot? If so, it's strange - the value is less than float max, and should work, also, the x values are all 1.47705e+09, but they are converted to different values. I wonder there would be a mistake. Can you try debug into the converting, to print out |
@liuxuan30 seems like you're right. So prints in lines 409/410 in LineChartRenderer (and in line 404 to see initial e1.x and e1.y). (both logs taken without any zooming. So seems like problem is not just in zooming.)
And from the 32bit:
|
it's subtle then. You see on 64bit, matrix values are more precise than 32 bit; that's the problem I guess. With these matrix values, the results could be different. But not that far. Your original values are closer, and the screen dots will be much closer for sure. It might an issue with CoreGraphics or ours, but looks like it can't be solved in a short time. I never met this before, and I suggest don't spend time on something you couldn't change easily. Also, double check your screenshot - your x axis label is 10:55, 10:56, 10:58(?), then 11:01, 11:03, 11:05. The interval is not equal, which means your had problems with x axis labels. Have you changed x axis code? Normally, x axis will calculate the labels, it shouldn't calculate something very close or not equal interval. If you think there is a bug, please help using ChartsDemo to reproduce, so we could have a look and fix it. |
@liuxuan30 actually, resolved it a little bit by subtracting starting date in unix timestamp format from the current one, so actual values on axis is near 100.000 and then adding it back, when formatting TimeInterval to date, and then date to string. I know, that not great solution, bit it obviously better than no solution at all. |
great :) |
I'm using iOS-Charts in my project. There are date values on xAxis in UNIX timestamp formatted to show hours and minutes .
Here is my ValueFormatter Code
When I try to zoom on 64bit processor devices - everything works just well, but when I try to zoom on 32bit device - I get such kind of result 32bit device zooming Labels are intersected, and I can't zoom more.
I tried to use granularity, forceLabelsEnabled and setLabelCount on xAxis - but nothing helps.
Thanks for any help. And thanks for such awesome library! You saved me so many times :)
The text was updated successfully, but these errors were encountered: