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
In ChartYAxisRenderer line 92 (iOS Charts v-2.2.5) (granularityEnabled is false),
let intervalMagnitude = ChartUtils.roundToNextSignificant(number: pow(10.0, floor(log10(interval))))
let intervalSigDigit = (interval / intervalMagnitude)
if (intervalSigDigit > 5)
{
// Use one order of magnitude higher, to avoid intervals like 0.9 or 90
interval = floor(10.0 * intervalMagnitude)
}
We are checking intervalSigDigit > 5, not sure where this value 5 is coming from, please provide some details about that if you can.
Now if for any reason (that is what happening to me) intervalMagnitude is less than 0.1 (let's say 0.06) and the intervalSigDigit is greater than 5 then we make the interval to be, floor(10.0 * 0.06) = 0. Now if forceLabels is not enabled then we calculate first and last value where we use that interval value (which is now 0) as the divisor and it results in NaN and causes the app to crash.
I can prevent the crash by checking if the floor(10.0 * intervalMagnitude) is 0 then skip using it or just set interval to 0.01 when floor(10.0 * intervalMagnitude) is 0. But I'm not sure if that is the correct way of doing it. Please respond if you get what I'm trying to explain and you have a better solution for it.
Thanks.
The text was updated successfully, but these errors were encountered:
In ChartYAxisRenderer line 92 (iOS Charts v-2.2.5) (granularityEnabled is false),
We are checking intervalSigDigit > 5, not sure where this value 5 is coming from, please provide some details about that if you can.
Now if for any reason (that is what happening to me) intervalMagnitude is less than 0.1 (let's say 0.06) and the intervalSigDigit is greater than 5 then we make the interval to be, floor(10.0 * 0.06) = 0. Now if forceLabels is not enabled then we calculate first and last value where we use that interval value (which is now 0) as the divisor and it results in NaN and causes the app to crash.
I can prevent the crash by checking if the floor(10.0 * intervalMagnitude) is 0 then skip using it or just set interval to 0.01 when floor(10.0 * intervalMagnitude) is 0. But I'm not sure if that is the correct way of doing it. Please respond if you get what I'm trying to explain and you have a better solution for it.
Thanks.
The text was updated successfully, but these errors were encountered: