├── .gitignore ├── ChartViewV2Demo.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ ├── IDEWorkspaceChecks.plist │ └── swiftpm │ └── Package.resolved ├── ChartViewV2Demo ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ └── LaunchScreen.storyboard ├── ContentView.swift ├── Info.plist ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json └── SceneDelegate.swift ├── LICENSE ├── README.md └── Resources └── showcase1.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | 28 | ## App packaging 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | ## Playgrounds 34 | timeline.xctimeline 35 | playground.xcworkspace 36 | 37 | # Swift Package Manager 38 | # 39 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 40 | # Packages/ 41 | # Package.pins 42 | # Package.resolved 43 | # *.xcodeproj 44 | # 45 | # Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata 46 | # hence it is not needed unless you have added a package configuration file to your project 47 | # .swiftpm 48 | 49 | .build/ 50 | 51 | # CocoaPods 52 | # 53 | # We recommend against adding the Pods directory to your .gitignore. However 54 | # you should judge for yourself, the pros and cons are mentioned at: 55 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 56 | # 57 | # Pods/ 58 | # 59 | # Add this line if you want to avoid checking in source code from the Xcode workspace 60 | # *.xcworkspace 61 | 62 | # Carthage 63 | # 64 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 65 | # Carthage/Checkouts 66 | 67 | Carthage/Build/ 68 | 69 | # Accio dependency management 70 | Dependencies/ 71 | .accio/ 72 | 73 | # fastlane 74 | # 75 | # It is recommended to not store the screenshots in the git repo. 76 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 77 | # For more information about the recommended setup visit: 78 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 79 | 80 | fastlane/report.xml 81 | fastlane/Preview.html 82 | fastlane/screenshots/**/*.png 83 | fastlane/test_output 84 | 85 | # Code Injection 86 | # 87 | # After new code Injection tools there's a generated folder /iOSInjectionProject 88 | # https://github.com/johnno1962/injectionforxcode 89 | 90 | iOSInjectionProject/ 91 | -------------------------------------------------------------------------------- /ChartViewV2Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 52; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 30E7E8DA24CCA69E0003F095 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30E7E8D924CCA69E0003F095 /* AppDelegate.swift */; }; 11 | 30E7E8DC24CCA69E0003F095 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30E7E8DB24CCA69E0003F095 /* SceneDelegate.swift */; }; 12 | 30E7E8DE24CCA69E0003F095 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30E7E8DD24CCA69E0003F095 /* ContentView.swift */; }; 13 | 30E7E8E024CCA6A10003F095 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 30E7E8DF24CCA6A10003F095 /* Assets.xcassets */; }; 14 | 30E7E8E324CCA6A10003F095 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 30E7E8E224CCA6A10003F095 /* Preview Assets.xcassets */; }; 15 | 30E7E8E624CCA6A10003F095 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 30E7E8E424CCA6A10003F095 /* LaunchScreen.storyboard */; }; 16 | 30E7E8EF24CCA6DB0003F095 /* SwiftUICharts in Frameworks */ = {isa = PBXBuildFile; productRef = 30E7E8EE24CCA6DB0003F095 /* SwiftUICharts */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 30E7E8D624CCA69E0003F095 /* ChartViewV2Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ChartViewV2Demo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 30E7E8D924CCA69E0003F095 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 22 | 30E7E8DB24CCA69E0003F095 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 23 | 30E7E8DD24CCA69E0003F095 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 24 | 30E7E8DF24CCA6A10003F095 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | 30E7E8E224CCA6A10003F095 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 26 | 30E7E8E524CCA6A10003F095 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 27 | 30E7E8E724CCA6A10003F095 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | /* End PBXFileReference section */ 29 | 30 | /* Begin PBXFrameworksBuildPhase section */ 31 | 30E7E8D324CCA69E0003F095 /* Frameworks */ = { 32 | isa = PBXFrameworksBuildPhase; 33 | buildActionMask = 2147483647; 34 | files = ( 35 | 30E7E8EF24CCA6DB0003F095 /* SwiftUICharts in Frameworks */, 36 | ); 37 | runOnlyForDeploymentPostprocessing = 0; 38 | }; 39 | /* End PBXFrameworksBuildPhase section */ 40 | 41 | /* Begin PBXGroup section */ 42 | 30E7E8CD24CCA69E0003F095 = { 43 | isa = PBXGroup; 44 | children = ( 45 | 30E7E8D824CCA69E0003F095 /* ChartViewV2Demo */, 46 | 30E7E8D724CCA69E0003F095 /* Products */, 47 | ); 48 | sourceTree = ""; 49 | }; 50 | 30E7E8D724CCA69E0003F095 /* Products */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | 30E7E8D624CCA69E0003F095 /* ChartViewV2Demo.app */, 54 | ); 55 | name = Products; 56 | sourceTree = ""; 57 | }; 58 | 30E7E8D824CCA69E0003F095 /* ChartViewV2Demo */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 30E7E8D924CCA69E0003F095 /* AppDelegate.swift */, 62 | 30E7E8DB24CCA69E0003F095 /* SceneDelegate.swift */, 63 | 30E7E8DD24CCA69E0003F095 /* ContentView.swift */, 64 | 30E7E8DF24CCA6A10003F095 /* Assets.xcassets */, 65 | 30E7E8E424CCA6A10003F095 /* LaunchScreen.storyboard */, 66 | 30E7E8E724CCA6A10003F095 /* Info.plist */, 67 | 30E7E8E124CCA6A10003F095 /* Preview Content */, 68 | ); 69 | path = ChartViewV2Demo; 70 | sourceTree = ""; 71 | }; 72 | 30E7E8E124CCA6A10003F095 /* Preview Content */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 30E7E8E224CCA6A10003F095 /* Preview Assets.xcassets */, 76 | ); 77 | path = "Preview Content"; 78 | sourceTree = ""; 79 | }; 80 | /* End PBXGroup section */ 81 | 82 | /* Begin PBXNativeTarget section */ 83 | 30E7E8D524CCA69E0003F095 /* ChartViewV2Demo */ = { 84 | isa = PBXNativeTarget; 85 | buildConfigurationList = 30E7E8EA24CCA6A10003F095 /* Build configuration list for PBXNativeTarget "ChartViewV2Demo" */; 86 | buildPhases = ( 87 | 30E7E8D224CCA69E0003F095 /* Sources */, 88 | 30E7E8D324CCA69E0003F095 /* Frameworks */, 89 | 30E7E8D424CCA69E0003F095 /* Resources */, 90 | ); 91 | buildRules = ( 92 | ); 93 | dependencies = ( 94 | ); 95 | name = ChartViewV2Demo; 96 | packageProductDependencies = ( 97 | 30E7E8EE24CCA6DB0003F095 /* SwiftUICharts */, 98 | ); 99 | productName = ChartViewV2Demo; 100 | productReference = 30E7E8D624CCA69E0003F095 /* ChartViewV2Demo.app */; 101 | productType = "com.apple.product-type.application"; 102 | }; 103 | /* End PBXNativeTarget section */ 104 | 105 | /* Begin PBXProject section */ 106 | 30E7E8CE24CCA69E0003F095 /* Project object */ = { 107 | isa = PBXProject; 108 | attributes = { 109 | LastSwiftUpdateCheck = 1150; 110 | LastUpgradeCheck = 1150; 111 | ORGANIZATIONNAME = "Samu András"; 112 | TargetAttributes = { 113 | 30E7E8D524CCA69E0003F095 = { 114 | CreatedOnToolsVersion = 11.5; 115 | }; 116 | }; 117 | }; 118 | buildConfigurationList = 30E7E8D124CCA69E0003F095 /* Build configuration list for PBXProject "ChartViewV2Demo" */; 119 | compatibilityVersion = "Xcode 9.3"; 120 | developmentRegion = en; 121 | hasScannedForEncodings = 0; 122 | knownRegions = ( 123 | en, 124 | Base, 125 | ); 126 | mainGroup = 30E7E8CD24CCA69E0003F095; 127 | packageReferences = ( 128 | 30E7E8ED24CCA6DB0003F095 /* XCRemoteSwiftPackageReference "ChartView" */, 129 | ); 130 | productRefGroup = 30E7E8D724CCA69E0003F095 /* Products */; 131 | projectDirPath = ""; 132 | projectRoot = ""; 133 | targets = ( 134 | 30E7E8D524CCA69E0003F095 /* ChartViewV2Demo */, 135 | ); 136 | }; 137 | /* End PBXProject section */ 138 | 139 | /* Begin PBXResourcesBuildPhase section */ 140 | 30E7E8D424CCA69E0003F095 /* Resources */ = { 141 | isa = PBXResourcesBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | 30E7E8E624CCA6A10003F095 /* LaunchScreen.storyboard in Resources */, 145 | 30E7E8E324CCA6A10003F095 /* Preview Assets.xcassets in Resources */, 146 | 30E7E8E024CCA6A10003F095 /* Assets.xcassets in Resources */, 147 | ); 148 | runOnlyForDeploymentPostprocessing = 0; 149 | }; 150 | /* End PBXResourcesBuildPhase section */ 151 | 152 | /* Begin PBXSourcesBuildPhase section */ 153 | 30E7E8D224CCA69E0003F095 /* Sources */ = { 154 | isa = PBXSourcesBuildPhase; 155 | buildActionMask = 2147483647; 156 | files = ( 157 | 30E7E8DA24CCA69E0003F095 /* AppDelegate.swift in Sources */, 158 | 30E7E8DC24CCA69E0003F095 /* SceneDelegate.swift in Sources */, 159 | 30E7E8DE24CCA69E0003F095 /* ContentView.swift in Sources */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXSourcesBuildPhase section */ 164 | 165 | /* Begin PBXVariantGroup section */ 166 | 30E7E8E424CCA6A10003F095 /* LaunchScreen.storyboard */ = { 167 | isa = PBXVariantGroup; 168 | children = ( 169 | 30E7E8E524CCA6A10003F095 /* Base */, 170 | ); 171 | name = LaunchScreen.storyboard; 172 | sourceTree = ""; 173 | }; 174 | /* End PBXVariantGroup section */ 175 | 176 | /* Begin XCBuildConfiguration section */ 177 | 30E7E8E824CCA6A10003F095 /* Debug */ = { 178 | isa = XCBuildConfiguration; 179 | buildSettings = { 180 | ALWAYS_SEARCH_USER_PATHS = NO; 181 | CLANG_ANALYZER_NONNULL = YES; 182 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 183 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 184 | CLANG_CXX_LIBRARY = "libc++"; 185 | CLANG_ENABLE_MODULES = YES; 186 | CLANG_ENABLE_OBJC_ARC = YES; 187 | CLANG_ENABLE_OBJC_WEAK = YES; 188 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 189 | CLANG_WARN_BOOL_CONVERSION = YES; 190 | CLANG_WARN_COMMA = YES; 191 | CLANG_WARN_CONSTANT_CONVERSION = YES; 192 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 193 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 194 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 195 | CLANG_WARN_EMPTY_BODY = YES; 196 | CLANG_WARN_ENUM_CONVERSION = YES; 197 | CLANG_WARN_INFINITE_RECURSION = YES; 198 | CLANG_WARN_INT_CONVERSION = YES; 199 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 200 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 201 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 202 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 203 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 204 | CLANG_WARN_STRICT_PROTOTYPES = YES; 205 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 206 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 207 | CLANG_WARN_UNREACHABLE_CODE = YES; 208 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 209 | COPY_PHASE_STRIP = NO; 210 | DEBUG_INFORMATION_FORMAT = dwarf; 211 | ENABLE_STRICT_OBJC_MSGSEND = YES; 212 | ENABLE_TESTABILITY = YES; 213 | GCC_C_LANGUAGE_STANDARD = gnu11; 214 | GCC_DYNAMIC_NO_PIC = NO; 215 | GCC_NO_COMMON_BLOCKS = YES; 216 | GCC_OPTIMIZATION_LEVEL = 0; 217 | GCC_PREPROCESSOR_DEFINITIONS = ( 218 | "DEBUG=1", 219 | "$(inherited)", 220 | ); 221 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 222 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 223 | GCC_WARN_UNDECLARED_SELECTOR = YES; 224 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 225 | GCC_WARN_UNUSED_FUNCTION = YES; 226 | GCC_WARN_UNUSED_VARIABLE = YES; 227 | IPHONEOS_DEPLOYMENT_TARGET = 13.5; 228 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 229 | MTL_FAST_MATH = YES; 230 | ONLY_ACTIVE_ARCH = YES; 231 | SDKROOT = iphoneos; 232 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 233 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 234 | }; 235 | name = Debug; 236 | }; 237 | 30E7E8E924CCA6A10003F095 /* Release */ = { 238 | isa = XCBuildConfiguration; 239 | buildSettings = { 240 | ALWAYS_SEARCH_USER_PATHS = NO; 241 | CLANG_ANALYZER_NONNULL = YES; 242 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 243 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 244 | CLANG_CXX_LIBRARY = "libc++"; 245 | CLANG_ENABLE_MODULES = YES; 246 | CLANG_ENABLE_OBJC_ARC = YES; 247 | CLANG_ENABLE_OBJC_WEAK = YES; 248 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 249 | CLANG_WARN_BOOL_CONVERSION = YES; 250 | CLANG_WARN_COMMA = YES; 251 | CLANG_WARN_CONSTANT_CONVERSION = YES; 252 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 253 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 254 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 255 | CLANG_WARN_EMPTY_BODY = YES; 256 | CLANG_WARN_ENUM_CONVERSION = YES; 257 | CLANG_WARN_INFINITE_RECURSION = YES; 258 | CLANG_WARN_INT_CONVERSION = YES; 259 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 260 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 261 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 262 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 263 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 264 | CLANG_WARN_STRICT_PROTOTYPES = YES; 265 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 266 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 267 | CLANG_WARN_UNREACHABLE_CODE = YES; 268 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 269 | COPY_PHASE_STRIP = NO; 270 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 271 | ENABLE_NS_ASSERTIONS = NO; 272 | ENABLE_STRICT_OBJC_MSGSEND = YES; 273 | GCC_C_LANGUAGE_STANDARD = gnu11; 274 | GCC_NO_COMMON_BLOCKS = YES; 275 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 276 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 277 | GCC_WARN_UNDECLARED_SELECTOR = YES; 278 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 279 | GCC_WARN_UNUSED_FUNCTION = YES; 280 | GCC_WARN_UNUSED_VARIABLE = YES; 281 | IPHONEOS_DEPLOYMENT_TARGET = 13.5; 282 | MTL_ENABLE_DEBUG_INFO = NO; 283 | MTL_FAST_MATH = YES; 284 | SDKROOT = iphoneos; 285 | SWIFT_COMPILATION_MODE = wholemodule; 286 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 287 | VALIDATE_PRODUCT = YES; 288 | }; 289 | name = Release; 290 | }; 291 | 30E7E8EB24CCA6A10003F095 /* Debug */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 295 | CODE_SIGN_STYLE = Automatic; 296 | DEVELOPMENT_ASSET_PATHS = "\"ChartViewV2Demo/Preview Content\""; 297 | DEVELOPMENT_TEAM = E4G5RJH99S; 298 | ENABLE_PREVIEWS = YES; 299 | INFOPLIST_FILE = ChartViewV2Demo/Info.plist; 300 | LD_RUNPATH_SEARCH_PATHS = ( 301 | "$(inherited)", 302 | "@executable_path/Frameworks", 303 | ); 304 | PRODUCT_BUNDLE_IDENTIFIER = com.samuandris.ChartViewV2Demo; 305 | PRODUCT_NAME = "$(TARGET_NAME)"; 306 | SWIFT_VERSION = 5.0; 307 | TARGETED_DEVICE_FAMILY = "1,2"; 308 | }; 309 | name = Debug; 310 | }; 311 | 30E7E8EC24CCA6A10003F095 /* Release */ = { 312 | isa = XCBuildConfiguration; 313 | buildSettings = { 314 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 315 | CODE_SIGN_STYLE = Automatic; 316 | DEVELOPMENT_ASSET_PATHS = "\"ChartViewV2Demo/Preview Content\""; 317 | DEVELOPMENT_TEAM = E4G5RJH99S; 318 | ENABLE_PREVIEWS = YES; 319 | INFOPLIST_FILE = ChartViewV2Demo/Info.plist; 320 | LD_RUNPATH_SEARCH_PATHS = ( 321 | "$(inherited)", 322 | "@executable_path/Frameworks", 323 | ); 324 | PRODUCT_BUNDLE_IDENTIFIER = com.samuandris.ChartViewV2Demo; 325 | PRODUCT_NAME = "$(TARGET_NAME)"; 326 | SWIFT_VERSION = 5.0; 327 | TARGETED_DEVICE_FAMILY = "1,2"; 328 | }; 329 | name = Release; 330 | }; 331 | /* End XCBuildConfiguration section */ 332 | 333 | /* Begin XCConfigurationList section */ 334 | 30E7E8D124CCA69E0003F095 /* Build configuration list for PBXProject "ChartViewV2Demo" */ = { 335 | isa = XCConfigurationList; 336 | buildConfigurations = ( 337 | 30E7E8E824CCA6A10003F095 /* Debug */, 338 | 30E7E8E924CCA6A10003F095 /* Release */, 339 | ); 340 | defaultConfigurationIsVisible = 0; 341 | defaultConfigurationName = Release; 342 | }; 343 | 30E7E8EA24CCA6A10003F095 /* Build configuration list for PBXNativeTarget "ChartViewV2Demo" */ = { 344 | isa = XCConfigurationList; 345 | buildConfigurations = ( 346 | 30E7E8EB24CCA6A10003F095 /* Debug */, 347 | 30E7E8EC24CCA6A10003F095 /* Release */, 348 | ); 349 | defaultConfigurationIsVisible = 0; 350 | defaultConfigurationName = Release; 351 | }; 352 | /* End XCConfigurationList section */ 353 | 354 | /* Begin XCRemoteSwiftPackageReference section */ 355 | 30E7E8ED24CCA6DB0003F095 /* XCRemoteSwiftPackageReference "ChartView" */ = { 356 | isa = XCRemoteSwiftPackageReference; 357 | repositoryURL = "https://github.com/AppPear/ChartView.git"; 358 | requirement = { 359 | kind = exactVersion; 360 | version = "2.0.0-beta.1"; 361 | }; 362 | }; 363 | /* End XCRemoteSwiftPackageReference section */ 364 | 365 | /* Begin XCSwiftPackageProductDependency section */ 366 | 30E7E8EE24CCA6DB0003F095 /* SwiftUICharts */ = { 367 | isa = XCSwiftPackageProductDependency; 368 | package = 30E7E8ED24CCA6DB0003F095 /* XCRemoteSwiftPackageReference "ChartView" */; 369 | productName = SwiftUICharts; 370 | }; 371 | /* End XCSwiftPackageProductDependency section */ 372 | }; 373 | rootObject = 30E7E8CE24CCA69E0003F095 /* Project object */; 374 | } 375 | -------------------------------------------------------------------------------- /ChartViewV2Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ChartViewV2Demo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ChartViewV2Demo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [ 4 | { 5 | "package": "SwiftUICharts", 6 | "repositoryURL": "https://github.com/AppPear/ChartView.git", 7 | "state": { 8 | "branch": null, 9 | "revision": "3265d3e16b6480158b748095a227ea04c48f80ad", 10 | "version": "2.0.0-beta.1" 11 | } 12 | } 13 | ] 14 | }, 15 | "version": 1 16 | } 17 | -------------------------------------------------------------------------------- /ChartViewV2Demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ChartViewV2Demo 4 | // 5 | // Created by Samu András on 2020. 07. 25.. 6 | // Copyright © 2020. Samu András. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 17 | // Override point for customization after application launch. 18 | return true 19 | } 20 | 21 | // MARK: UISceneSession Lifecycle 22 | 23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 24 | // Called when a new scene session is being created. 25 | // Use this method to select a configuration to create the new scene with. 26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 27 | } 28 | 29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 30 | // Called when the user discards a scene session. 31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 33 | } 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /ChartViewV2Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /ChartViewV2Demo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ChartViewV2Demo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ChartViewV2Demo/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // ChartViewV2Demo 4 | // 5 | // Created by Samu András on 2020. 07. 25.. 6 | // Copyright © 2020. Samu András. All rights reserved. 7 | // 8 | 9 | import SwiftUI 10 | import SwiftUICharts 11 | 12 | struct ContentView: View { 13 | 14 | @State private var selectedTab = 1 15 | 16 | @State var data1: [Double] = (0..<16).map { _ in .random(in: 9.0...100.0) } 17 | @State var data2: [Double] = (0..<16).map { _ in .random(in: 9.0...100.0) } 18 | @State var data3: [Double] = (0..<12).map { _ in .random(in: 9.0...100.0) } 19 | @State var data4: [Double] = (0..<8) .map { _ in .random(in: 1.0...125.0) } 20 | 21 | let mixedColorStyle = ChartStyle(backgroundColor: .white, foregroundColor: [ 22 | ColorGradient(ChartColors.orangeBright, ChartColors.orangeDark), 23 | ColorGradient(.purple, .blue) 24 | ]) 25 | let blueStyle = ChartStyle(backgroundColor: .white, 26 | foregroundColor: [ColorGradient(.purple, .blue)]) 27 | let orangeStyle = ChartStyle(backgroundColor: .white, 28 | foregroundColor: [ColorGradient(ChartColors.orangeBright, ChartColors.orangeDark)]) 29 | 30 | let multiStyle = ChartStyle(backgroundColor: Color.green.opacity(0.2), 31 | foregroundColor: 32 | [ColorGradient(.purple, .blue), 33 | ColorGradient(.orange, .red), 34 | ColorGradient(.green, .yellow), 35 | ColorGradient(.red, .purple), 36 | ColorGradient(.yellow, .orange), 37 | ]) 38 | 39 | var body: some View { 40 | VStack { 41 | 42 | HStack { 43 | Button(action: { 44 | self.data1 = (0..<16).map { _ in .random(in: 9.0...100.0) } as [Double] 45 | self.data2 = (0..<16).map { _ in .random(in: 9.0...100.0) } as [Double] 46 | self.data3 = (0..<16).map { _ in .random(in: 9.0...100.0) } as [Double] 47 | self.data4 = (0..<8) .map { _ in .random(in: 1.0...125.0) } as [Double] 48 | }) { 49 | Text("Shuffle baby") 50 | } 51 | 52 | Spacer() 53 | // Other controls 54 | } 55 | .padding() 56 | 57 | TabView(selection: $selectedTab) { 58 | 59 | VStack { 60 | 61 | BarChart() 62 | .data(data2) 63 | .chartStyle(mixedColorStyle) 64 | 65 | 66 | CardView { 67 | ChartLabel("Bar Chart", type: .legend) 68 | BarChart() 69 | } 70 | .data(data3) 71 | .chartStyle(orangeStyle) 72 | .frame(width: 160, height: 240) 73 | .padding() 74 | } 75 | .tabItem { Image(systemName:"chart.bar.xaxis") }.tag(1) 76 | VStack { 77 | 78 | PieChart() 79 | .data(data1) 80 | .chartStyle(orangeStyle) 81 | 82 | CardView { 83 | ChartLabel("Pie Chart", type: .title) 84 | PieChart() 85 | } 86 | .data(data2) 87 | .chartStyle(blueStyle) 88 | .padding() 89 | 90 | 91 | } 92 | .tabItem { Image(systemName:"chart.pie.fill") }.tag(2) 93 | 94 | 95 | 96 | VStack { 97 | 98 | CardView(showShadow: true) { 99 | ChartLabel("Line Chart", type: .subTitle) 100 | LineChart() 101 | } 102 | .data(data1) 103 | .chartStyle(blueStyle) 104 | .padding() 105 | 106 | 107 | LineChart() 108 | .data(data2) 109 | .chartStyle(orangeStyle) 110 | 111 | } 112 | .tabItem { Image(systemName:"waveform.path.ecg.rectangle") }.tag(3) 113 | 114 | VStack { 115 | 116 | RingsChart() 117 | .data(self.data4) 118 | .chartStyle(multiStyle) 119 | .padding() 120 | 121 | CardView(showShadow: false) { 122 | ChartLabel("Rings Chart", type: .legend) 123 | RingsChart() 124 | } 125 | .data(Array(self.data4[0...2])) 126 | .chartStyle(multiStyle) 127 | .frame(width: 130, height: 130) 128 | .padding([.bottom]) 129 | 130 | } 131 | .tabItem { Image(systemName:"circle") }.tag(4) 132 | } 133 | } 134 | } 135 | } 136 | 137 | struct ContentView_Previews: PreviewProvider { 138 | static var previews: some View { 139 | ContentView() 140 | } 141 | } 142 | 143 | -------------------------------------------------------------------------------- /ChartViewV2Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | 37 | 38 | 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UISupportedInterfaceOrientations~ipad 53 | 54 | UIInterfaceOrientationPortrait 55 | UIInterfaceOrientationPortraitUpsideDown 56 | UIInterfaceOrientationLandscapeLeft 57 | UIInterfaceOrientationLandscapeRight 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /ChartViewV2Demo/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ChartViewV2Demo/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // ChartViewV2Demo 4 | // 5 | // Created by Samu András on 2020. 07. 25.. 6 | // Copyright © 2020. Samu András. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftUI 11 | 12 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 18 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 19 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 20 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 21 | 22 | // Create the SwiftUI view that provides the window contents. 23 | let contentView = ContentView() 24 | 25 | // Use a UIHostingController as window root view controller. 26 | if let windowScene = scene as? UIWindowScene { 27 | let window = UIWindow(windowScene: windowScene) 28 | window.rootViewController = UIHostingController(rootView: contentView) 29 | self.window = window 30 | window.makeKeyAndVisible() 31 | } 32 | } 33 | 34 | func sceneDidDisconnect(_ scene: UIScene) { 35 | // Called as the scene is being released by the system. 36 | // This occurs shortly after the scene enters the background, or when its session is discarded. 37 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 38 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 39 | } 40 | 41 | func sceneDidBecomeActive(_ scene: UIScene) { 42 | // Called when the scene has moved from an inactive state to an active state. 43 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 44 | } 45 | 46 | func sceneWillResignActive(_ scene: UIScene) { 47 | // Called when the scene will move from an active state to an inactive state. 48 | // This may occur due to temporary interruptions (ex. an incoming phone call). 49 | } 50 | 51 | func sceneWillEnterForeground(_ scene: UIScene) { 52 | // Called as the scene transitions from the background to the foreground. 53 | // Use this method to undo the changes made on entering the background. 54 | } 55 | 56 | func sceneDidEnterBackground(_ scene: UIScene) { 57 | // Called as the scene transitions from the foreground to the background. 58 | // Use this method to save data, release shared resources, and store enough scene-specific state information 59 | // to restore the scene back to its current state. 60 | } 61 | 62 | 63 | } 64 | 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Andras Samu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ChartViewV2Demo 2 | Demo code for the upcoming SwiftUI ChartView v2 release 3 | 4 | In V2 a new structure is introduced. With this you will be able to create your charts with more modularity. 5 | 6 | ![SwiftUI Charts](./Resources/showcase1.gif "SwiftUI Charts") 7 | 8 | ## Creating a basic chart 9 | 10 | You can create 11 | * barchart 12 | * linechart 13 | * piechart 14 | 15 | To create a chart, initialise the chart type you would like to have then give it data and style: 16 | ```swift 17 | @State var chartData: [Double] = [0, 5, 6, 2, 13, 4, 3, 6] 18 | 19 | BarChart() 20 | .data(chartData) 21 | .style(ChartStyle(...)) 22 | ``` 23 | 24 | ## Creating a cardview chart 25 | 26 | To create a cardview chart, you just embed a basic chart in a CardView element, also cardview is a normal view now, so you can specify your frame if you like: 27 | 28 | ```swift 29 | CardView { 30 | ChartLabel("Title", type: .title) 31 | BarChart() 32 | } 33 | .data(chartData) 34 | .style(ChartStyle(...)) 35 | ``` 36 | 37 | or 38 | 39 | ```swift 40 | CardView { 41 | BarChart() 42 | ChartLabel("Text", type: .custom(...)) 43 | } 44 | .data(chartData) 45 | .style(ChartStyle(...)) 46 | ``` 47 | 48 | ## Adding a title, subtitle or custom text 49 | 50 | Title, subtitle and text is now a standalone element, called `ChartLabel`. When you interact with the chart, the current chart value will automatically appear in place of the text in ChartLabel. You can add a ChartLabel by inserting above or below the chart: 51 | 52 | ```swift 53 | CardView { 54 | BarChart() 55 | } 56 | .data(chartData) 57 | .style(ChartStyle(...)) 58 | .frame(width: 160, height: 240) 59 | ``` 60 | 61 | ## ChartLabel 62 | 63 | Has types: 64 | * `title` 65 | * `largeTitle` 66 | * `subtitle` 67 | * `legend` 68 | * `custom(size: CGFloat, padding: EdgeInsets, color: Color)` 69 | 70 | ## ChartStyle 71 | 72 | ChartStyle contains as for now the backgournd and foreground color. Foreground color property is a array so you can have multiple colors in some charts. 73 | Colors are a type of ColorGradient so it supports linear grandients and simple colors too. 74 | 75 | initialisers: 76 | 77 | * `public init(backgroundColor: Color, foregroundColor: [ColorGradient])` 78 | * `public init(backgroundColor: Color, foregroundColor: ColorGradient)` 79 | * `public init(backgroundColor: ColorGradient, foregroundColor: ColorGradient)` 80 | * `public init(backgroundColor: ColorGradient, foregroundColor: [ColorGradient])` 81 | 82 | ## CardView 83 | 84 | `public init(showShadow: Bool = true, @ViewBuilder content: @escaping () -> Content)` 85 | 86 | 87 | -------------------------------------------------------------------------------- /Resources/showcase1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppPear/ChartViewV2Demo/8bb8db47497c7d2d404ac6ba0f27e4754b72245f/Resources/showcase1.gif --------------------------------------------------------------------------------