You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
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: