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
I have three scatter plots on a view controller, in this case each with only one dot. I removed the data so the charts were empty, then tried to select another set of data. By then, it had already crashed. The difference is that I had updated my Mac OS, my iPad iOS and my Xcode version.
What did you expect to happen?
No crash.
What happened instead?
Crash
Charts Environment
Charts 3.4.0
Xcode 11.6
Swift 5.2
iPad mini running iOS 13.6
development machine running OS 10.15.6
Here are the errors:
The indicator pointed to line 119 in Pod/Pods/Charts/Core/AxisRendererBase.swift computeAxisValues(min:max:)
Fatal error: Double value cannot be converted to Int because it is either infinite or NaN: file /Library/Caches/com.apple.xbs/Binaries/SwiftPrebuiltSDKModules_iOS/install/TempContent/Objects/EmbeddedProjects/CrossTrain_iOS_SDK/iOS_SDK/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/swift/Swift.swiftmodule/arm64.swiftinterface, line 28468
In this function:
/// Sets up the axis values. Computes the desired number of labels between the two given extremes. @objc open func computeAxisValues(min: Double, max: Double)
{
guard let axis = self.axis else { return }
let yMin = min
let yMax = max
let labelCount = axis.labelCount
let range = abs(yMax - yMin)
if labelCount == 0 || range <= 0 || range.isInfinite
{
axis.entries = [Double]()
axis.centeredEntries = [Double]()
return
}
// Find out how much spacing (in y value space) between axis values
let rawInterval = range / Double(labelCount)
var interval = rawInterval.roundedToNextSignficant()
// If granularity is enabled, then do not allow the interval to go below specified granularity.
// This is used to avoid repeated values when rounding values for display.
if axis.granularityEnabled
{
interval = interval < axis.granularity ? axis.granularity : interval
}
// Normalize interval
let intervalMagnitude = pow(10.0, Double(Int(log10(interval)))).roundedToNextSignficant() <--- The line just above here crashes
let intervalSigDigit = Int(interval / intervalMagnitude)
etc.
In the debugger:
min = (Double) NaN
max = (Double) NaN
interval = (Double) NaN
n = (Int) 0
yMin = (Double) NaN
yMax = (Double) NaN
labelCount = (Int) 6
range = (Double) NaN
rawInterval = (Double) NaN
intervalMagnitude (Double)
intervalSigDigit (Int)
self = (Charts.YAxisRenderer) long number
axis = (Charts.YAxis) long number and lots of sub categories
The first thing I did after all the upgrades was to go into my development app to see if I had successfully managed to prevent all gestures from affecting the charts. Nope - they still move, but in this case, for the first time ever, they also crashed. Hope this helps.
The text was updated successfully, but these errors were encountered:
I just tried to edit my post and can't so the line in the code that says "<--- the line just above here crashes" is actually pointing straight at the line that crashed. The variable "interval" is NaN when it arrived at that line.
Hi - thank you for the wonderful Charts app.
I have three scatter plots on a view controller, in this case each with only one dot. I removed the data so the charts were empty, then tried to select another set of data. By then, it had already crashed. The difference is that I had updated my Mac OS, my iPad iOS and my Xcode version.
What did you expect to happen?
No crash.
What happened instead?
Crash
Charts Environment
Charts 3.4.0
Xcode 11.6
Swift 5.2
iPad mini running iOS 13.6
development machine running OS 10.15.6
Here are the errors:
The indicator pointed to line 119 in Pod/Pods/Charts/Core/AxisRendererBase.swift computeAxisValues(min:max:)
Fatal error: Double value cannot be converted to Int because it is either infinite or NaN: file /Library/Caches/com.apple.xbs/Binaries/SwiftPrebuiltSDKModules_iOS/install/TempContent/Objects/EmbeddedProjects/CrossTrain_iOS_SDK/iOS_SDK/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/swift/Swift.swiftmodule/arm64.swiftinterface, line 28468
In this function:
/// Sets up the axis values. Computes the desired number of labels between the two given extremes.
@objc open func computeAxisValues(min: Double, max: Double)
{
guard let axis = self.axis else { return }
In the debugger:
min = (Double) NaN
max = (Double) NaN
interval = (Double) NaN
n = (Int) 0
yMin = (Double) NaN
yMax = (Double) NaN
labelCount = (Int) 6
range = (Double) NaN
rawInterval = (Double) NaN
intervalMagnitude (Double)
intervalSigDigit (Int)
self = (Charts.YAxisRenderer) long number
axis = (Charts.YAxis) long number and lots of sub categories
The first thing I did after all the upgrades was to go into my development app to see if I had successfully managed to prevent all gestures from affecting the charts. Nope - they still move, but in this case, for the first time ever, they also crashed. Hope this helps.
The text was updated successfully, but these errors were encountered: