File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
AAInfographics/AAChartCreator Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 3030
3131 */
3232
33+ import Foundation
34+
3335// MARK: - Configure Chart View Content With AAChartModel
3436@available ( iOS 10 . 0 , macCatalyst 13 . 1 , macOS 10 . 13 , * )
3537extension AAChartView {
@@ -69,12 +71,16 @@ extension AAChartView {
6971 public func aa_drawChartWithChartOptions( _ aaOptions: AAOptions ) {
7072 if optionsJson == nil {
7173 configureOptionsJsonStringWithAAOptions ( aaOptions)
72- let path = BundlePathLoader ( )
74+ guard let path = BundlePathLoader ( )
7375 . path ( forResource: " AAChartView " ,
7476 ofType: " html " ,
75- inDirectory: " AAJSFiles.bundle " )
76- let urlStr = URL ( fileURLWithPath: path!)
77- let urlRequest = URLRequest ( url: urlStr)
77+ inDirectory: " AAJSFiles.bundle " ) else {
78+ // Consider more robust error handling or logging framework for production code
79+ print ( " Error: AAChartView.html not found in AAJSFiles.bundle. Chart cannot be loaded. " )
80+ return
81+ }
82+ let fileURL = URL ( fileURLWithPath: path) // 'path' is a non-optional String here
83+ let urlRequest = URLRequest ( url: fileURL)
7884 load ( urlRequest)
7985 } else {
8086 aa_refreshChartWholeContentWithChartOptions ( aaOptions)
You can’t perform that action at this time.
0 commit comments