-
-
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
y axis spaces between labels are too wide #120
Comments
Can you show an example? I can't think of a case where the spacing between labels is to wide, as it could absolutely be zero. Maybe you are talking about the modulus of which labels to show. You can set a custom modulus to 0. |
The thing is that ChartData.calcXValAverageLength returns the average x label length in bytes (not chars) and ChartXAxisRenderer.computeAxis uses the retuned value as chars count. |
danielgindi
added a commit
that referenced
this issue
Jun 2, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The y axis spaces between labels are too wide even when spaceBetweenLabels=0.
I've fixed this issue by changing ChartXAxisRenderer - computeAxis (line 33) from:
var max = Int(round(xValAverageLength + Float(_xAxis.spaceBetweenLabels)));
to
var max = Int(round((xValAverageLength / 2) + Float(_xAxis.spaceBetweenLabels)));
I'm not sure if this is the best way to resolve the issue, it might be better to change ChartData - calcXValAverageLength (line 113):
sum += _xVals[i] == nil ? 0 : _xVals[i]!.lengthOfBytesUsingEncoding(NSUTF16StringEncoding);
The text was updated successfully, but these errors were encountered: