├── .DS_Store ├── Pods ├── Target Support Files │ ├── Charts │ │ ├── Charts.modulemap │ │ ├── Charts-dummy.m │ │ ├── Charts-prefix.pch │ │ ├── Charts-umbrella.h │ │ ├── Charts.debug.xcconfig │ │ ├── Charts.release.xcconfig │ │ ├── Charts.xcconfig │ │ ├── Info.plist │ │ └── Charts-Info.plist │ ├── Pods-LineChartExample │ │ ├── Pods-LineChartExample.modulemap │ │ ├── Pods-LineChartExample-dummy.m │ │ ├── Pods-LineChartExample-umbrella.h │ │ ├── Pods-LineChartExample.debug.xcconfig │ │ ├── Pods-LineChartExample.release.xcconfig │ │ ├── Info.plist │ │ └── Pods-LineChartExample-Info.plist │ ├── Pods-LineChartExampleTests │ │ ├── Pods-LineChartExampleTests-acknowledgements.markdown │ │ ├── Pods-LineChartExampleTests.modulemap │ │ ├── Pods-LineChartExampleTests-dummy.m │ │ ├── Pods-LineChartExampleTests-umbrella.h │ │ ├── Pods-LineChartExampleTests.debug.xcconfig │ │ ├── Pods-LineChartExampleTests.release.xcconfig │ │ ├── Info.plist │ │ ├── Pods-LineChartExampleTests-Info.plist │ │ └── Pods-LineChartExampleTests-acknowledgements.plist │ └── Pods-LineChartExampleUITests │ │ ├── Pods-LineChartExampleUITests-acknowledgements.markdown │ │ ├── Pods-LineChartExampleUITests.modulemap │ │ ├── Pods-LineChartExampleUITests-dummy.m │ │ ├── Pods-LineChartExampleUITests-umbrella.h │ │ ├── Pods-LineChartExampleUITests.debug.xcconfig │ │ ├── Pods-LineChartExampleUITests.release.xcconfig │ │ ├── Info.plist │ │ ├── Pods-LineChartExampleUITests-Info.plist │ │ └── Pods-LineChartExampleUITests-acknowledgements.plist ├── Manifest.lock ├── Charts │ └── Source │ │ └── Charts │ │ ├── Interfaces │ │ ├── BubbleChartDataProvider 2.swift │ │ ├── BubbleChartDataProvider.swift │ │ ├── CandleChartDataProvider 2.swift │ │ ├── CandleChartDataProvider.swift │ │ ├── ScatterChartDataProvider 2.swift │ │ ├── ScatterChartDataProvider.swift │ │ ├── LineChartDataProvider.swift │ │ ├── CombinedChartDataProvider 2.swift │ │ ├── CombinedChartDataProvider.swift │ │ ├── BarChartDataProvider.swift │ │ ├── BarChartDataProvider 2.swift │ │ ├── BarLineScatterCandleBubbleChartDataProvider 2.swift │ │ ├── BarLineScatterCandleBubbleChartDataProvider.swift │ │ ├── ChartDataProvider.swift │ │ └── ChartDataProvider 2.swift │ │ ├── Data │ │ ├── Implementations │ │ │ └── Standard │ │ │ │ ├── CandleChartData 2.swift │ │ │ │ ├── CandleChartData.swift │ │ │ │ ├── BarLineScatterCandleBubbleChartData.swift │ │ │ │ ├── LineChartData.swift │ │ │ │ ├── BubbleChartData.swift │ │ │ │ ├── ScatterChartData.swift │ │ │ │ ├── BubbleChartData 2.swift │ │ │ │ ├── BarLineScatterCandleBubbleChartDataSet.swift │ │ │ │ ├── RadarChartDataEntry.swift │ │ │ │ ├── ScatterChartData 2.swift │ │ │ │ ├── RadarChartData.swift │ │ │ │ ├── BubbleChartDataSet.swift │ │ │ │ ├── RadarChartDataSet.swift │ │ │ │ ├── RadarChartDataSet 2.swift │ │ │ │ ├── LineScatterCandleRadarChartDataSet.swift │ │ │ │ ├── LineScatterCandleRadarChartDataSet 2.swift │ │ │ │ ├── BubbleChartDataEntry.swift │ │ │ │ ├── ChartDataEntryBase.swift │ │ │ │ ├── LineRadarChartDataSet.swift │ │ │ │ ├── ScatterChartDataSet.swift │ │ │ │ ├── CandleChartDataEntry.swift │ │ │ │ ├── ChartDataEntry.swift │ │ │ │ └── PieChartData 2.swift │ │ └── Interfaces │ │ │ ├── IBubbleChartDataSet.swift │ │ │ ├── IBarLineScatterCandleBubbleChartDataSet.swift │ │ │ ├── IBarLineScatterCandleBubbleChartDataSet 2.swift │ │ │ ├── IScatterChartDataSet.swift │ │ │ ├── IScatterChartDataSet 2.swift │ │ │ ├── IRadarChartDataSet.swift │ │ │ ├── IRadarChartDataSet 2.swift │ │ │ ├── ILineScatterCandleRadarChartDataSet.swift │ │ │ ├── ILineScatterCandleRadarChartDataSet 2.swift │ │ │ ├── IBarChartDataSet.swift │ │ │ ├── ILineRadarChartDataSet.swift │ │ │ ├── ICandleChartDataSet.swift │ │ │ ├── IPieChartDataSet 2.swift │ │ │ ├── IPieChartDataSet.swift │ │ │ └── ILineChartDataSet.swift │ │ ├── Highlight │ │ ├── IHighlighter.swift │ │ ├── PieHighlighter.swift │ │ ├── Range.swift │ │ ├── PieRadarHighlighter.swift │ │ ├── HorizontalBarHighlighter.swift │ │ ├── CombinedHighlighter.swift │ │ └── RadarHighlighter.swift │ │ ├── Renderers │ │ ├── Renderer.swift │ │ ├── Scatter │ │ │ ├── IShapeRenderer.swift │ │ │ ├── CrossShapeRenderer.swift │ │ │ ├── XShapeRenderer 2.swift │ │ │ ├── XShapeRenderer.swift │ │ │ ├── ChevronUpShapeRenderer.swift │ │ │ ├── ChevronDownShapeRenderer.swift │ │ │ ├── SquareShapeRenderer.swift │ │ │ ├── CircleShapeRenderer.swift │ │ │ └── TriangleShapeRenderer.swift │ │ ├── LineRadarRenderer.swift │ │ ├── LineScatterCandleRadarRenderer.swift │ │ └── XAxisRendererRadarChart.swift │ │ ├── Charts │ │ ├── BubbleChartView.swift │ │ ├── LineChartView.swift │ │ ├── ScatterChartView.swift │ │ └── CandleStickChartView.swift │ │ ├── Formatters │ │ ├── IFillFormatter.swift │ │ ├── IAxisValueFormatter.swift │ │ ├── IAxisValueFormatter 2.swift │ │ ├── IValueFormatter.swift │ │ ├── IndexAxisValueFormatter.swift │ │ ├── DefaultFillFormatter.swift │ │ ├── DefaultAxisValueFormatter.swift │ │ └── DefaultValueFormatter.swift │ │ ├── Jobs │ │ ├── MoveViewJob.swift │ │ ├── AnimatedMoveViewJob.swift │ │ ├── ViewPortJob.swift │ │ ├── ZoomViewJob.swift │ │ └── AnimatedZoomViewJob.swift │ │ ├── Components │ │ ├── ComponentBase.swift │ │ ├── Description 2.swift │ │ ├── Description.swift │ │ ├── IMarker.swift │ │ ├── ChartLimitLine.swift │ │ ├── XAxis.swift │ │ ├── MarkerView.swift │ │ ├── MarkerImage.swift │ │ └── LegendEntry.swift │ │ └── Utils │ │ ├── TransformerHorizontalBarChart.swift │ │ └── Platform+Color.swift └── Pods.xcodeproj │ └── xcuserdata │ └── osiansmith.xcuserdatad │ └── xcschemes │ ├── xcschememanagement.plist │ ├── Charts.xcscheme │ ├── Pods-LineChartExample.xcscheme │ ├── Pods-LineChartExampleTests.xcscheme │ └── Pods-LineChartExampleUITests.xcscheme ├── LineChartExample.xcworkspace ├── xcuserdata │ └── osiansmith.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── LineChartExample.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── osiansmith.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── osiansmith.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── Podfile.lock ├── Podfile ├── README.md ├── LineChartExampleTests ├── Info.plist └── LineChartExampleTests.swift ├── LineChartExampleUITests ├── Info.plist └── LineChartExampleUITests.swift ├── LICENSE └── LineChartExample ├── Assets.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Info.plist ├── Base.lproj └── LaunchScreen.storyboard ├── AppDelegate.swift └── ViewController.swift /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osianSmith/LineChartExample/HEAD/.DS_Store -------------------------------------------------------------------------------- /Pods/Target Support Files/Charts/Charts.modulemap: -------------------------------------------------------------------------------- 1 | framework module Charts { 2 | umbrella header "Charts-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Charts/Charts-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Charts : NSObject 3 | @end 4 | @implementation PodsDummy_Charts 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExample/Pods-LineChartExample.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_LineChartExample { 2 | umbrella header "Pods-LineChartExample-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExample/Pods-LineChartExample-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LineChartExample : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LineChartExample 5 | @end 6 | -------------------------------------------------------------------------------- /LineChartExample.xcworkspace/xcuserdata/osiansmith.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osianSmith/LineChartExample/HEAD/LineChartExample.xcworkspace/xcuserdata/osiansmith.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleTests/Pods-LineChartExampleTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleTests/Pods-LineChartExampleTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_LineChartExampleTests { 2 | umbrella header "Pods-LineChartExampleTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleUITests/Pods-LineChartExampleUITests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /LineChartExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleTests/Pods-LineChartExampleTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LineChartExampleTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LineChartExampleTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleUITests/Pods-LineChartExampleUITests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_LineChartExampleUITests { 2 | umbrella header "Pods-LineChartExampleUITests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleUITests/Pods-LineChartExampleUITests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LineChartExampleUITests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LineChartExampleUITests 5 | @end 6 | -------------------------------------------------------------------------------- /LineChartExample.xcodeproj/project.xcworkspace/xcuserdata/osiansmith.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/osianSmith/LineChartExample/HEAD/LineChartExample.xcodeproj/project.xcworkspace/xcuserdata/osiansmith.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Pods/Target Support Files/Charts/Charts-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /LineChartExample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /LineChartExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Charts (3.5.0): 3 | - Charts/Core (= 3.5.0) 4 | - Charts/Core (3.5.0) 5 | 6 | DEPENDENCIES: 7 | - Charts 8 | 9 | SPEC REPOS: 10 | trunk: 11 | - Charts 12 | 13 | SPEC CHECKSUMS: 14 | Charts: 40a08591df1f8ad5c223ddedfb1a06da92f24f7c 15 | 16 | PODFILE CHECKSUM: d1df39e44095f33ff2951f4e63f5c85e57467efe 17 | 18 | COCOAPODS: 1.9.1 19 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Charts (3.5.0): 3 | - Charts/Core (= 3.5.0) 4 | - Charts/Core (3.5.0) 5 | 6 | DEPENDENCIES: 7 | - Charts 8 | 9 | SPEC REPOS: 10 | trunk: 11 | - Charts 12 | 13 | SPEC CHECKSUMS: 14 | Charts: 40a08591df1f8ad5c223ddedfb1a06da92f24f7c 15 | 16 | PODFILE CHECKSUM: d1df39e44095f33ff2951f4e63f5c85e57467efe 17 | 18 | COCOAPODS: 1.9.1 19 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Charts/Charts-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double ChartsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char ChartsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExample/Pods-LineChartExample-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_LineChartExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_LineChartExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleTests/Pods-LineChartExampleTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_LineChartExampleTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_LineChartExampleTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleUITests/Pods-LineChartExampleUITests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_LineChartExampleUITestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_LineChartExampleUITestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/BubbleChartDataProvider 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BubbleChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol BubbleChartDataProvider: BarLineScatterCandleBubbleChartDataProvider 17 | { 18 | var bubbleData: BubbleChartData? { get } 19 | } -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/BubbleChartDataProvider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BubbleChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol BubbleChartDataProvider: BarLineScatterCandleBubbleChartDataProvider 17 | { 18 | var bubbleData: BubbleChartData? { get } 19 | } -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/CandleChartDataProvider 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CandleChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol CandleChartDataProvider: BarLineScatterCandleBubbleChartDataProvider 17 | { 18 | var candleData: CandleChartData? { get } 19 | } -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/CandleChartDataProvider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CandleChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol CandleChartDataProvider: BarLineScatterCandleBubbleChartDataProvider 17 | { 18 | var candleData: CandleChartData? { get } 19 | } -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/ScatterChartDataProvider 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScatterChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol ScatterChartDataProvider: BarLineScatterCandleBubbleChartDataProvider 17 | { 18 | var scatterData: ScatterChartData? { get } 19 | } -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/ScatterChartDataProvider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScatterChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol ScatterChartDataProvider: BarLineScatterCandleBubbleChartDataProvider 17 | { 18 | var scatterData: ScatterChartData? { get } 19 | } -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'LineChartExample' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for LineChartExample 9 | pod 'Charts' 10 | target 'LineChartExampleTests' do 11 | inherit! :search_paths 12 | # Pods for testing 13 | end 14 | 15 | target 'LineChartExampleUITests' do 16 | inherit! :search_paths 17 | # Pods for testing 18 | end 19 | 20 | end 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LineChartExample 2 | The sample application from my LineChartDemo post on Medium 3 | 4 | Feel free to use my code and use it to learn — break it, fix it or even turn it into another type of chart!  5 | 6 | Any comments or issues, you can comment on my Medium post or make an issue on the github page. I will try to get back to you! 7 | 8 | Link to article: 9 | https://medium.com/@OsianSmith/creating-a-line-chart-in-swift-3-and-ios-10-2f647c95392e 10 | 11 | © Osian Smith 2017. All rights resereved. Use this code at your own risk but with credit to Osian Smith 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Charts/Charts.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Charts 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Charts 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Charts/Charts.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Charts 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Charts 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/LineChartDataProvider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol LineChartDataProvider: BarLineScatterCandleBubbleChartDataProvider 17 | { 18 | var lineData: LineChartData? { get } 19 | 20 | func getAxis(_ axis: YAxis.AxisDependency) -> YAxis 21 | } 22 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Charts/Charts.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Charts 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Charts 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/CombinedChartDataProvider 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CombinedChartDataProvider.swoft 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol CombinedChartDataProvider: LineChartDataProvider, BarChartDataProvider, BubbleChartDataProvider, CandleChartDataProvider, ScatterChartDataProvider 17 | { 18 | var combinedData: CombinedChartData? { get } 19 | } -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/CombinedChartDataProvider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CombinedChartDataProvider.swoft 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol CombinedChartDataProvider: LineChartDataProvider, BarChartDataProvider, BubbleChartDataProvider, CandleChartDataProvider, ScatterChartDataProvider 17 | { 18 | var combinedData: CombinedChartData? { get } 19 | } -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleTests/Pods-LineChartExampleTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts/Charts.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "Charts" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleTests/Pods-LineChartExampleTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts/Charts.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "Charts" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleUITests/Pods-LineChartExampleUITests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts/Charts.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "Charts" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleUITests/Pods-LineChartExampleUITests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts/Charts.framework/Headers" 4 | OTHER_LDFLAGS = $(inherited) -framework "Charts" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CandleChartData.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | open class CandleChartData: BarLineScatterCandleBubbleChartData 15 | { 16 | public override init() 17 | { 18 | super.init() 19 | } 20 | 21 | public override init(dataSets: [IChartDataSet]?) 22 | { 23 | super.init(dataSets: dataSets) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CandleChartData.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | open class CandleChartData: BarLineScatterCandleBubbleChartData 15 | { 16 | public override init() 17 | { 18 | super.init() 19 | } 20 | 21 | public override init(dataSets: [IChartDataSet]?) 22 | { 23 | super.init(dataSets: dataSets) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Highlight/IHighlighter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IHighlighter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(IChartHighlighter) 16 | public protocol IHighlighter: class 17 | { 18 | /// - Parameters: 19 | /// - x: 20 | /// - y: 21 | /// - Returns: A Highlight object corresponding to the given x- and y- touch positions in pixels. 22 | func getHighlight(x: CGFloat, y: CGFloat) -> Highlight? 23 | } 24 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BarLineScatterCandleBubbleChartData.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | open class BarLineScatterCandleBubbleChartData: ChartData 15 | { 16 | public override init() 17 | { 18 | super.init() 19 | } 20 | 21 | public override init(dataSets: [IChartDataSet]?) 22 | { 23 | super.init(dataSets: dataSets) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/BarChartDataProvider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BarChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol BarChartDataProvider: BarLineScatterCandleBubbleChartDataProvider 17 | { 18 | var barData: BarChartData? { get } 19 | 20 | var isDrawBarShadowEnabled: Bool { get } 21 | var isDrawValueAboveBarEnabled: Bool { get } 22 | var isHighlightFullBarEnabled: Bool { get } 23 | } -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/BarChartDataProvider 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BarChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol BarChartDataProvider: BarLineScatterCandleBubbleChartDataProvider 17 | { 18 | var barData: BarChartData? { get } 19 | 20 | var isDrawBarShadowEnabled: Bool { get } 21 | var isDrawValueAboveBarEnabled: Bool { get } 22 | var isHighlightFullBarEnabled: Bool { get } 23 | } -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/LineChartData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineChartData.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | /// Data object that encapsulates all data associated with a LineChart. 15 | open class LineChartData: ChartData 16 | { 17 | public override init() 18 | { 19 | super.init() 20 | } 21 | 22 | public override init(dataSets: [IChartDataSet]?) 23 | { 24 | super.init(dataSets: dataSets) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/Renderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Renderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(ChartRenderer) 16 | open class Renderer: NSObject 17 | { 18 | /// the component that handles the drawing area of the chart and it's offsets 19 | @objc public let viewPortHandler: ViewPortHandler 20 | 21 | @objc public init(viewPortHandler: ViewPortHandler) 22 | { 23 | self.viewPortHandler = viewPortHandler 24 | super.init() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BarLineScatterCandleBubbleChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol BarLineScatterCandleBubbleChartDataProvider: ChartDataProvider 17 | { 18 | func getTransformer(forAxis: YAxis.AxisDependency) -> Transformer 19 | func isInverted(axis: YAxis.AxisDependency) -> Bool 20 | 21 | var lowestVisibleX: Double { get } 22 | var highestVisibleX: Double { get } 23 | } 24 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/BarLineScatterCandleBubbleChartDataProvider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BarLineScatterCandleBubbleChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol BarLineScatterCandleBubbleChartDataProvider: ChartDataProvider 17 | { 18 | func getTransformer(forAxis: YAxis.AxisDependency) -> Transformer 19 | func isInverted(axis: YAxis.AxisDependency) -> Bool 20 | 21 | var lowestVisibleX: Double { get } 22 | var highestVisibleX: Double { get } 23 | } 24 | -------------------------------------------------------------------------------- /LineChartExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LineChartExampleUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Charts/BubbleChartView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BubbleChartView.swift 3 | // Charts 4 | // 5 | // Bubble chart implementation: 6 | // Copyright 2015 Pierre-Marc Airoldi 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | open class BubbleChartView: BarLineChartViewBase, BubbleChartDataProvider 16 | { 17 | open override func initialize() 18 | { 19 | super.initialize() 20 | 21 | renderer = BubbleChartRenderer(dataProvider: self, animator: _animator, viewPortHandler: _viewPortHandler) 22 | } 23 | 24 | // MARK: - BubbleChartDataProvider 25 | 26 | open var bubbleData: BubbleChartData? { return _data as? BubbleChartData } 27 | } 28 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExample/Pods-LineChartExample.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts/Charts.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "Charts" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Formatters/IFillFormatter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IFillFormatter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | /// Protocol for providing a custom logic to where the filling line of a LineDataSet should end. This of course only works if setFillEnabled(...) is set to true. 16 | @objc(IChartFillFormatter) 17 | public protocol IFillFormatter 18 | { 19 | /// - Returns: The vertical (y-axis) position where the filled-line of the LineDataSet should end. 20 | func getFillLinePosition(dataSet: ILineChartDataSet, dataProvider: LineChartDataProvider) -> CGFloat 21 | } 22 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExample/Pods-LineChartExample.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Charts/Charts.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "Charts" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/IBubbleChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBubbleChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol IBubbleChartDataSet: IBarLineScatterCandleBubbleChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | var maxSize: CGFloat { get } 21 | var isNormalizeSizeEnabled: Bool { get } 22 | 23 | // MARK: - Styling functions and accessors 24 | 25 | /// Sets/gets the width of the circle that surrounds the bubble when highlighted 26 | var highlightCircleWidth: CGFloat { get set } 27 | } 28 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBarLineScatterCandleBubbleChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol IBarLineScatterCandleBubbleChartDataSet: IChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | // MARK: - Styling functions and accessors 21 | 22 | var highlightColor: NSUIColor { get set } 23 | var highlightLineWidth: CGFloat { get set } 24 | var highlightLineDashPhase: CGFloat { get set } 25 | var highlightLineDashLengths: [CGFloat]? { get set } 26 | } 27 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/IBarLineScatterCandleBubbleChartDataSet 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBarLineScatterCandleBubbleChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol IBarLineScatterCandleBubbleChartDataSet: IChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | // MARK: - Styling functions and accessors 21 | 22 | var highlightColor: NSUIColor { get set } 23 | var highlightLineWidth: CGFloat { get set } 24 | var highlightLineDashPhase: CGFloat { get set } 25 | var highlightLineDashLengths: [CGFloat]? { get set } 26 | } 27 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Charts/LineChartView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineChartView.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | /// Chart that draws lines, surfaces, circles, ... 16 | open class LineChartView: BarLineChartViewBase, LineChartDataProvider 17 | { 18 | internal override func initialize() 19 | { 20 | super.initialize() 21 | 22 | renderer = LineChartRenderer(dataProvider: self, animator: _animator, viewPortHandler: _viewPortHandler) 23 | } 24 | 25 | // MARK: - LineChartDataProvider 26 | 27 | open var lineData: LineChartData? { return _data as? LineChartData } 28 | } 29 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Highlight/PieHighlighter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PieHighlighter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(PieChartHighlighter) 16 | open class PieHighlighter: PieRadarHighlighter 17 | { 18 | open override func closestHighlight(index: Int, x: CGFloat, y: CGFloat) -> Highlight? 19 | { 20 | guard 21 | let set = chart?.data?.dataSets[0], 22 | let entry = set.entryForIndex(index) 23 | else { return nil } 24 | 25 | return Highlight(x: Double(index), y: entry.y, xPx: x, yPx: y, dataSetIndex: 0, axis: set.axisDependency) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/osiansmith.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Charts.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-LineChartExample.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods-LineChartExampleTests.xcscheme 18 | 19 | isShown 20 | 21 | 22 | Pods-LineChartExampleUITests.xcscheme 23 | 24 | isShown 25 | 26 | 27 | 28 | SuppressBuildableAutocreation 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /LineChartExample.xcodeproj/xcuserdata/osiansmith.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | LineChartExample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 28C90CF31F16E4F4001378A1 16 | 17 | primary 18 | 19 | 20 | 28C90D071F16E4F5001378A1 21 | 22 | primary 23 | 24 | 25 | 28C90D121F16E4F5001378A1 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Jobs/MoveViewJob.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MoveViewJob.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(MoveChartViewJob) 16 | open class MoveViewJob: ViewPortJob 17 | { 18 | open override func doJob() 19 | { 20 | guard 21 | let viewPortHandler = viewPortHandler, 22 | let transformer = transformer, 23 | let view = view 24 | else { return } 25 | 26 | var pt = CGPoint( 27 | x: xValue, 28 | y: yValue 29 | ) 30 | 31 | transformer.pointValueToPixel(&pt) 32 | viewPortHandler.centerViewPort(pt: pt, chart: view) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Charts/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.0.4 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Charts/Charts-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.5.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BubbleChartData.swift 3 | // Charts 4 | // 5 | // Bubble chart implementation: 6 | // Copyright 2015 Pierre-Marc Airoldi 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | open class BubbleChartData: BarLineScatterCandleBubbleChartData 16 | { 17 | public override init() 18 | { 19 | super.init() 20 | } 21 | 22 | public override init(dataSets: [IChartDataSet]?) 23 | { 24 | super.init(dataSets: dataSets) 25 | } 26 | 27 | /// Sets the width of the circle that surrounds the bubble when highlighted for all DataSet objects this data object contains 28 | @objc open func setHighlightCircleWidth(_ width: CGFloat) 29 | { 30 | (_dataSets as? [IBubbleChartDataSet])?.forEach { $0.highlightCircleWidth = width } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Charts/ScatterChartView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScatterChartView.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | /// The ScatterChart. Draws dots, triangles, squares and custom shapes into the chartview. 16 | open class ScatterChartView: BarLineChartViewBase, ScatterChartDataProvider 17 | { 18 | open override func initialize() 19 | { 20 | super.initialize() 21 | 22 | renderer = ScatterChartRenderer(dataProvider: self, animator: _animator, viewPortHandler: _viewPortHandler) 23 | 24 | xAxis.spaceMin = 0.5 25 | xAxis.spaceMax = 0.5 26 | } 27 | 28 | // MARK: - ScatterChartDataProvider 29 | 30 | open var scatterData: ScatterChartData? { return _data as? ScatterChartData } 31 | } 32 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScatterChartData.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | open class ScatterChartData: BarLineScatterCandleBubbleChartData 16 | { 17 | public override init() 18 | { 19 | super.init() 20 | } 21 | 22 | public override init(dataSets: [IChartDataSet]?) 23 | { 24 | super.init(dataSets: dataSets) 25 | } 26 | 27 | /// - Returns: The maximum shape-size across all DataSets. 28 | @objc open func getGreatestShapeSize() -> CGFloat 29 | { 30 | return (_dataSets as? [IScatterChartDataSet])? 31 | .max { $0.scatterShapeSize < $1.scatterShapeSize }? 32 | .scatterShapeSize ?? 0 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExample/Pods-LineChartExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Jobs/AnimatedMoveViewJob.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AnimatedMoveViewJob.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | open class AnimatedMoveViewJob: AnimatedViewPortJob 16 | { 17 | internal override func animationUpdate() 18 | { 19 | guard 20 | let viewPortHandler = viewPortHandler, 21 | let transformer = transformer, 22 | let view = view 23 | else { return } 24 | 25 | var pt = CGPoint( 26 | x: xOrigin + (CGFloat(xValue) - xOrigin) * phase, 27 | y: yOrigin + (CGFloat(yValue) - yOrigin) * phase 28 | ) 29 | 30 | transformer.pointValueToPixel(&pt) 31 | viewPortHandler.centerViewPort(pt: pt, chart: view) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleTests/Pods-LineChartExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleTests/Pods-LineChartExampleTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleUITests/Pods-LineChartExampleUITests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-LineChartExampleUITests/Pods-LineChartExampleUITests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Charts/CandleStickChartView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CandleStickChartView.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | /// Financial chart type that draws candle-sticks. 16 | open class CandleStickChartView: BarLineChartViewBase, CandleChartDataProvider 17 | { 18 | internal override func initialize() 19 | { 20 | super.initialize() 21 | 22 | renderer = CandleStickChartRenderer(dataProvider: self, animator: _animator, viewPortHandler: _viewPortHandler) 23 | 24 | self.xAxis.spaceMin = 0.5 25 | self.xAxis.spaceMax = 0.5 26 | } 27 | 28 | // MARK: - CandleChartDataProvider 29 | 30 | open var candleData: CandleChartData? 31 | { 32 | return _data as? CandleChartData 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartData 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BubbleChartData.swift 3 | // Charts 4 | // 5 | // Bubble chart implementation: 6 | // Copyright 2015 Pierre-Marc Airoldi 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | open class BubbleChartData: BarLineScatterCandleBubbleChartData 16 | { 17 | public override init() 18 | { 19 | super.init() 20 | } 21 | 22 | public override init(dataSets: [IChartDataSet]?) 23 | { 24 | super.init(dataSets: dataSets) 25 | } 26 | 27 | /// Sets the width of the circle that surrounds the bubble when highlighted for all DataSet objects this data object contains 28 | @objc open func setHighlightCircleWidth(_ width: CGFloat) 29 | { 30 | for set in (_dataSets as? [IBubbleChartDataSet])! 31 | { 32 | set.highlightCircleWidth = width 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/Scatter/IShapeRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IShapeRenderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol IShapeRenderer: class 17 | { 18 | /// Renders the provided ScatterDataSet with a shape. 19 | /// 20 | /// - Parameters: 21 | /// - context: CGContext for drawing on 22 | /// - dataSet: The DataSet to be drawn 23 | /// - viewPortHandler: Contains information about the current state of the view 24 | /// - point: Position to draw the shape at 25 | /// - color: Color to draw the shape 26 | func renderShape( 27 | context: CGContext, 28 | dataSet: IScatterChartDataSet, 29 | viewPortHandler: ViewPortHandler, 30 | point: CGPoint, 31 | color: NSUIColor) 32 | } 33 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Formatters/IAxisValueFormatter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IAxisValueFormatter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | /// An interface for providing custom axis Strings. 15 | @objc(IChartAxisValueFormatter) 16 | public protocol IAxisValueFormatter: class 17 | { 18 | 19 | /// Called when a value from an axis is formatted before being drawn. 20 | /// 21 | /// For performance reasons, avoid excessive calculations and memory allocations inside this method. 22 | /// 23 | /// - Parameters: 24 | /// - value: the value that is currently being drawn 25 | /// - axis: the axis that the value belongs to 26 | /// - Returns: The customized label that is drawn on the x-axis. 27 | func stringForValue(_ value: Double, 28 | axis: AxisBase?) -> String 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Formatters/IAxisValueFormatter 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IAxisValueFormatter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | /// An interface for providing custom axis Strings. 15 | @objc(IChartAxisValueFormatter) 16 | public protocol IAxisValueFormatter : NSObjectProtocol 17 | { 18 | 19 | /// Called when a value from an axis is formatted before being drawn. 20 | /// 21 | /// For performance reasons, avoid excessive calculations and memory allocations inside this method. 22 | /// 23 | /// - returns: The customized label that is drawn on the x-axis. 24 | /// - parameter value: the value that is currently being drawn 25 | /// - parameter axis: the axis that the value belongs to 26 | /// 27 | func stringForValue(_ value: Double, 28 | axis: AxisBase?) -> String 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Components/ComponentBase.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ComponentBase.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | 16 | /// This class encapsulates everything both Axis, Legend and LimitLines have in common 17 | @objc(ChartComponentBase) 18 | open class ComponentBase: NSObject 19 | { 20 | /// flag that indicates if this component is enabled or not 21 | @objc open var enabled = true 22 | 23 | /// The offset this component has on the x-axis 24 | /// **default**: 5.0 25 | @objc open var xOffset = CGFloat(5.0) 26 | 27 | /// The offset this component has on the x-axis 28 | /// **default**: 5.0 (or 0.0 on ChartYAxis) 29 | @objc open var yOffset = CGFloat(5.0) 30 | 31 | public override init() 32 | { 33 | super.init() 34 | } 35 | 36 | @objc open var isEnabled: Bool { return enabled } 37 | } 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Osian Smith 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 | -------------------------------------------------------------------------------- /LineChartExampleTests/LineChartExampleTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineChartExampleTests.swift 3 | // LineChartExampleTests 4 | // 5 | // Created by Osian on 13/07/2017. 6 | // Copyright © 2017 Osian. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import LineChartExample 11 | 12 | class LineChartExampleTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Utils/TransformerHorizontalBarChart.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TransformerHorizontalBarChart.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(ChartTransformerHorizontalBarChart) 16 | open class TransformerHorizontalBarChart: Transformer 17 | { 18 | /// Prepares the matrix that contains all offsets. 19 | open override func prepareMatrixOffset(inverted: Bool) 20 | { 21 | if !inverted 22 | { 23 | _matrixOffset = CGAffineTransform(translationX: _viewPortHandler.offsetLeft, y: _viewPortHandler.chartHeight - _viewPortHandler.offsetBottom) 24 | } 25 | else 26 | { 27 | _matrixOffset = CGAffineTransform(scaleX: -1.0, y: 1.0) 28 | _matrixOffset = _matrixOffset.translatedBy(x: -(_viewPortHandler.chartWidth - _viewPortHandler.offsetRight), 29 | y: _viewPortHandler.chartHeight - _viewPortHandler.offsetBottom) 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/ChartDataProvider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol ChartDataProvider 17 | { 18 | /// The minimum x-value of the chart, regardless of zoom or translation. 19 | var chartXMin: Double { get } 20 | 21 | /// The maximum x-value of the chart, regardless of zoom or translation. 22 | var chartXMax: Double { get } 23 | 24 | /// The minimum y-value of the chart, regardless of zoom or translation. 25 | var chartYMin: Double { get } 26 | 27 | /// The maximum y-value of the chart, regardless of zoom or translation. 28 | var chartYMax: Double { get } 29 | 30 | var maxHighlightDistance: CGFloat { get } 31 | 32 | var xRange: Double { get } 33 | 34 | var centerOffsets: CGPoint { get } 35 | 36 | var data: ChartData? { get } 37 | 38 | var maxVisibleCount: Int { get } 39 | } 40 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Interfaces/ChartDataProvider 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChartDataProvider.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol ChartDataProvider 17 | { 18 | /// - returns: The minimum x-value of the chart, regardless of zoom or translation. 19 | var chartXMin: Double { get } 20 | 21 | /// - returns: The maximum x-value of the chart, regardless of zoom or translation. 22 | var chartXMax: Double { get } 23 | 24 | /// - returns: The minimum y-value of the chart, regardless of zoom or translation. 25 | var chartYMin: Double { get } 26 | 27 | /// - returns: The maximum y-value of the chart, regardless of zoom or translation. 28 | var chartYMax: Double { get } 29 | 30 | var maxHighlightDistance: CGFloat { get } 31 | 32 | var xRange: Double { get } 33 | 34 | var centerOffsets: CGPoint { get } 35 | 36 | var data: ChartData? { get } 37 | 38 | var maxVisibleCount: Int { get } 39 | } -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IScatterChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol IScatterChartDataSet: ILineScatterCandleRadarChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | // MARK: - Styling functions and accessors 21 | 22 | /// The size the scatter shape will have 23 | var scatterShapeSize: CGFloat { get } 24 | 25 | /// - Returns: The radius of the hole in the shape (applies to Square, Circle and Triangle) 26 | /// Set this to <= 0 to remove holes. 27 | /// **default**: 0.0 28 | var scatterShapeHoleRadius: CGFloat { get } 29 | 30 | /// - Returns: Color for the hole in the shape. Setting to `nil` will behave as transparent. 31 | /// **default**: nil 32 | var scatterShapeHoleColor: NSUIColor? { get } 33 | 34 | /// The IShapeRenderer responsible for rendering this DataSet. 35 | var shapeRenderer: IShapeRenderer? { get } 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/Scatter/CrossShapeRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CrossShapeRenderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | import Foundation 12 | import CoreGraphics 13 | 14 | open class CrossShapeRenderer : NSObject, IShapeRenderer 15 | { 16 | open func renderShape( 17 | context: CGContext, 18 | dataSet: IScatterChartDataSet, 19 | viewPortHandler: ViewPortHandler, 20 | point: CGPoint, 21 | color: NSUIColor) 22 | { 23 | let shapeSize = dataSet.scatterShapeSize 24 | let shapeHalf = shapeSize / 2.0 25 | 26 | context.setLineWidth(1.0) 27 | context.setStrokeColor(color.cgColor) 28 | 29 | context.beginPath() 30 | context.move(to: CGPoint(x: point.x - shapeHalf, y: point.y)) 31 | context.addLine(to: CGPoint(x: point.x + shapeHalf, y: point.y)) 32 | context.move(to: CGPoint(x: point.x, y: point.y - shapeHalf)) 33 | context.addLine(to: CGPoint(x: point.x, y: point.y + shapeHalf)) 34 | context.strokePath() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XShapeRenderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | import Foundation 12 | 13 | open class XShapeRenderer : NSObject, IShapeRenderer 14 | { 15 | open func renderShape( 16 | context: CGContext, 17 | dataSet: IScatterChartDataSet, 18 | viewPortHandler: ViewPortHandler, 19 | point: CGPoint, 20 | color: NSUIColor) 21 | { 22 | let shapeSize = dataSet.scatterShapeSize 23 | let shapeHalf = shapeSize / 2.0 24 | 25 | context.setLineWidth(1.0) 26 | context.setStrokeColor(color.cgColor) 27 | 28 | context.beginPath() 29 | context.move(to: CGPoint(x: point.x - shapeHalf, y: point.y - shapeHalf)) 30 | context.addLine(to: CGPoint(x: point.x + shapeHalf, y: point.y + shapeHalf)) 31 | context.move(to: CGPoint(x: point.x + shapeHalf, y: point.y - shapeHalf)) 32 | context.addLine(to: CGPoint(x: point.x - shapeHalf, y: point.y + shapeHalf)) 33 | context.strokePath() 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/IScatterChartDataSet 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IScatterChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol IScatterChartDataSet: ILineScatterCandleRadarChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | // MARK: - Styling functions and accessors 21 | 22 | /// - returns: The size the scatter shape will have 23 | var scatterShapeSize: CGFloat { get } 24 | 25 | /// - returns: The radius of the hole in the shape (applies to Square, Circle and Triangle) 26 | /// Set this to <= 0 to remove holes. 27 | /// **default**: 0.0 28 | var scatterShapeHoleRadius: CGFloat { get } 29 | 30 | /// - returns: Color for the hole in the shape. Setting to `nil` will behave as transparent. 31 | /// **default**: nil 32 | var scatterShapeHoleColor: NSUIColor? { get } 33 | 34 | /// - returns: The IShapeRenderer responsible for rendering this DataSet. 35 | var shapeRenderer: IShapeRenderer? { get } 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Utils/Platform+Color.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Platform+Color.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | #if canImport(UIKit) 13 | import UIKit 14 | 15 | public typealias NSUIColor = UIColor 16 | private func fetchLabelColor() -> UIColor 17 | { 18 | if #available(iOS 13, tvOS 13, *) 19 | { 20 | return .label 21 | } 22 | else 23 | { 24 | return .black 25 | } 26 | } 27 | private let labelColor: UIColor = fetchLabelColor() 28 | 29 | extension UIColor 30 | { 31 | static var labelOrBlack: UIColor { labelColor } 32 | } 33 | #endif 34 | 35 | #if canImport(AppKit) && !targetEnvironment(macCatalyst) 36 | 37 | import AppKit 38 | 39 | public typealias NSUIColor = NSColor 40 | private func fetchLabelColor() -> NSColor 41 | { 42 | if #available(macOS 10.14, *) 43 | { 44 | return .labelColor 45 | } 46 | else 47 | { 48 | return .black 49 | } 50 | } 51 | private let labelColor: NSColor = fetchLabelColor() 52 | 53 | extension NSColor 54 | { 55 | static var labelOrBlack: NSColor { labelColor } 56 | } 57 | #endif 58 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/Scatter/XShapeRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XShapeRenderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | import Foundation 12 | import CoreGraphics 13 | 14 | open class XShapeRenderer : NSObject, IShapeRenderer 15 | { 16 | open func renderShape( 17 | context: CGContext, 18 | dataSet: IScatterChartDataSet, 19 | viewPortHandler: ViewPortHandler, 20 | point: CGPoint, 21 | color: NSUIColor) 22 | { 23 | let shapeSize = dataSet.scatterShapeSize 24 | let shapeHalf = shapeSize / 2.0 25 | 26 | context.setLineWidth(1.0) 27 | context.setStrokeColor(color.cgColor) 28 | 29 | context.beginPath() 30 | context.move(to: CGPoint(x: point.x - shapeHalf, y: point.y - shapeHalf)) 31 | context.addLine(to: CGPoint(x: point.x + shapeHalf, y: point.y + shapeHalf)) 32 | context.move(to: CGPoint(x: point.x + shapeHalf, y: point.y - shapeHalf)) 33 | context.addLine(to: CGPoint(x: point.x - shapeHalf, y: point.y + shapeHalf)) 34 | context.strokePath() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Highlight/Range.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Range.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | @objc(ChartRange) 15 | open class Range: NSObject 16 | { 17 | @objc open var from: Double 18 | @objc open var to: Double 19 | 20 | @objc public init(from: Double, to: Double) 21 | { 22 | self.from = from 23 | self.to = to 24 | 25 | super.init() 26 | } 27 | 28 | /// - Parameters: 29 | /// - value: 30 | /// - Returns: `true` if this range contains (if the value is in between) the given value, `false` ifnot. 31 | @objc open func contains(_ value: Double) -> Bool 32 | { 33 | if value > from && value <= to 34 | { 35 | return true 36 | } 37 | else 38 | { 39 | return false 40 | } 41 | } 42 | 43 | @objc open func isLarger(_ value: Double) -> Bool 44 | { 45 | return value > to 46 | } 47 | 48 | @objc open func isSmaller(_ value: Double) -> Bool 49 | { 50 | return value < from 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IRadarChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol IRadarChartDataSet: ILineRadarChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | // MARK: - Styling functions and accessors 21 | 22 | /// flag indicating whether highlight circle should be drawn or not 23 | var drawHighlightCircleEnabled: Bool { get set } 24 | 25 | var isDrawHighlightCircleEnabled: Bool { get } 26 | 27 | var highlightCircleFillColor: NSUIColor? { get set } 28 | 29 | /// The stroke color for highlight circle. 30 | /// If `nil`, the color of the dataset is taken. 31 | var highlightCircleStrokeColor: NSUIColor? { get set } 32 | 33 | var highlightCircleStrokeAlpha: CGFloat { get set } 34 | 35 | var highlightCircleInnerRadius: CGFloat { get set } 36 | 37 | var highlightCircleOuterRadius: CGFloat { get set } 38 | 39 | var highlightCircleStrokeWidth: CGFloat { get set } 40 | } 41 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/IRadarChartDataSet 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IRadarChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol IRadarChartDataSet: ILineRadarChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | // MARK: - Styling functions and accessors 21 | 22 | /// flag indicating whether highlight circle should be drawn or not 23 | var drawHighlightCircleEnabled: Bool { get set } 24 | 25 | var isDrawHighlightCircleEnabled: Bool { get } 26 | 27 | var highlightCircleFillColor: NSUIColor? { get set } 28 | 29 | /// The stroke color for highlight circle. 30 | /// If `nil`, the color of the dataset is taken. 31 | var highlightCircleStrokeColor: NSUIColor? { get set } 32 | 33 | var highlightCircleStrokeAlpha: CGFloat { get set } 34 | 35 | var highlightCircleInnerRadius: CGFloat { get set } 36 | 37 | var highlightCircleOuterRadius: CGFloat { get set } 38 | 39 | var highlightCircleStrokeWidth: CGFloat { get set } 40 | } 41 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/Scatter/ChevronUpShapeRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChevronUpShapeRenderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | import Foundation 12 | import CoreGraphics 13 | 14 | open class ChevronUpShapeRenderer : NSObject, IShapeRenderer 15 | { 16 | open func renderShape( 17 | context: CGContext, 18 | dataSet: IScatterChartDataSet, 19 | viewPortHandler: ViewPortHandler, 20 | point: CGPoint, 21 | color: NSUIColor) 22 | { 23 | let shapeSize = dataSet.scatterShapeSize 24 | let shapeHalf = shapeSize / 2.0 25 | 26 | context.setLineWidth(1.0) 27 | context.setStrokeColor(color.cgColor) 28 | 29 | context.beginPath() 30 | context.move(to: CGPoint(x: point.x, y: point.y - 2 * shapeHalf)) 31 | context.addLine(to: CGPoint(x: point.x + 2 * shapeHalf, y: point.y)) 32 | context.move(to: CGPoint(x: point.x, y: point.y - 2 * shapeHalf)) 33 | context.addLine(to: CGPoint(x: point.x - 2 * shapeHalf, y: point.y)) 34 | context.strokePath() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/Scatter/ChevronDownShapeRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChevronDownShapeRenderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | import Foundation 12 | import CoreGraphics 13 | 14 | open class ChevronDownShapeRenderer : NSObject, IShapeRenderer 15 | { 16 | open func renderShape( 17 | context: CGContext, 18 | dataSet: IScatterChartDataSet, 19 | viewPortHandler: ViewPortHandler, 20 | point: CGPoint, 21 | color: NSUIColor) 22 | { 23 | let shapeSize = dataSet.scatterShapeSize 24 | let shapeHalf = shapeSize / 2.0 25 | 26 | context.setLineWidth(1.0) 27 | context.setStrokeColor(color.cgColor) 28 | 29 | context.beginPath() 30 | context.move(to: CGPoint(x: point.x, y: point.y + 2 * shapeHalf)) 31 | context.addLine(to: CGPoint(x: point.x + 2 * shapeHalf, y: point.y)) 32 | context.move(to: CGPoint(x: point.x, y: point.y + 2 * shapeHalf)) 33 | context.addLine(to: CGPoint(x: point.x - 2 * shapeHalf, y: point.y)) 34 | context.strokePath() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Jobs/ViewPortJob.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewPortJob.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | // This defines a viewport modification job, used for delaying or animating viewport changes 16 | @objc(ChartViewPortJob) 17 | open class ViewPortJob: NSObject 18 | { 19 | internal var point: CGPoint = CGPoint() 20 | internal weak var viewPortHandler: ViewPortHandler? 21 | internal var xValue: Double = 0.0 22 | internal var yValue: Double = 0.0 23 | internal weak var transformer: Transformer? 24 | internal weak var view: ChartViewBase? 25 | 26 | @objc public init( 27 | viewPortHandler: ViewPortHandler, 28 | xValue: Double, 29 | yValue: Double, 30 | transformer: Transformer, 31 | view: ChartViewBase) 32 | { 33 | super.init() 34 | 35 | self.viewPortHandler = viewPortHandler 36 | self.xValue = xValue 37 | self.yValue = yValue 38 | self.transformer = transformer 39 | self.view = view 40 | } 41 | 42 | @objc open func doJob() 43 | { 44 | fatalError("`doJob()` must be overridden by subclasses") 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /LineChartExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/BarLineScatterCandleBubbleChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BarLineScatterCandleBubbleChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | 16 | open class BarLineScatterCandleBubbleChartDataSet: ChartDataSet, IBarLineScatterCandleBubbleChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | // MARK: - Styling functions and accessors 21 | 22 | open var highlightColor = NSUIColor(red: 255.0/255.0, green: 187.0/255.0, blue: 115.0/255.0, alpha: 1.0) 23 | open var highlightLineWidth = CGFloat(0.5) 24 | open var highlightLineDashPhase = CGFloat(0.0) 25 | open var highlightLineDashLengths: [CGFloat]? 26 | 27 | // MARK: - NSCopying 28 | 29 | open override func copy(with zone: NSZone? = nil) -> Any 30 | { 31 | let copy = super.copy(with: zone) as! BarLineScatterCandleBubbleChartDataSet 32 | copy.highlightColor = highlightColor 33 | copy.highlightLineWidth = highlightLineWidth 34 | copy.highlightLineDashPhase = highlightLineDashPhase 35 | copy.highlightLineDashLengths = highlightLineDashLengths 36 | return copy 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LineChartExampleUITests/LineChartExampleUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineChartExampleUITests.swift 3 | // LineChartExampleUITests 4 | // 5 | // Created by Osian on 13/07/2017. 6 | // Copyright © 2017 Osian. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class LineChartExampleUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RadarChartDataEntry.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | open class RadarChartDataEntry: ChartDataEntry 16 | { 17 | public required init() 18 | { 19 | super.init() 20 | } 21 | 22 | /// - Parameters: 23 | /// - value: The value on the y-axis. 24 | @objc public init(value: Double) 25 | { 26 | super.init(x: .nan, y: value) 27 | } 28 | 29 | /// - Parameters: 30 | /// - value: The value on the y-axis. 31 | /// - data: Spot for additional data this Entry represents. 32 | @objc public convenience init(value: Double, data: Any?) 33 | { 34 | self.init(value: value) 35 | self.data = data 36 | } 37 | 38 | // MARK: Data property accessors 39 | 40 | @objc open var value: Double 41 | { 42 | get { return y } 43 | set { y = newValue } 44 | } 45 | 46 | // MARK: NSCopying 47 | 48 | open override func copy(with zone: NSZone? = nil) -> Any 49 | { 50 | let copy = super.copy(with: zone) as! RadarChartDataEntry 51 | 52 | return copy 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ILineScatterCandleRadarChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | @objc 15 | public protocol ILineScatterCandleRadarChartDataSet: IBarLineScatterCandleBubbleChartDataSet 16 | { 17 | // MARK: - Data functions and accessors 18 | 19 | // MARK: - Styling functions and accessors 20 | 21 | /// Enables / disables the horizontal highlight-indicator. If disabled, the indicator is not drawn. 22 | var drawHorizontalHighlightIndicatorEnabled: Bool { get set } 23 | 24 | /// Enables / disables the vertical highlight-indicator. If disabled, the indicator is not drawn. 25 | var drawVerticalHighlightIndicatorEnabled: Bool { get set } 26 | 27 | /// `true` if horizontal highlight indicator lines are enabled (drawn) 28 | var isHorizontalHighlightIndicatorEnabled: Bool { get } 29 | 30 | /// `true` if vertical highlight indicator lines are enabled (drawn) 31 | var isVerticalHighlightIndicatorEnabled: Bool { get } 32 | 33 | /// Enables / disables both vertical and horizontal highlight-indicators. 34 | /// :param: enabled 35 | func setDrawHighlightIndicators(_ enabled: Bool) 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ILineScatterCandleRadarChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | @objc 15 | public protocol ILineScatterCandleRadarChartDataSet: IBarLineScatterCandleBubbleChartDataSet 16 | { 17 | // MARK: - Data functions and accessors 18 | 19 | // MARK: - Styling functions and accessors 20 | 21 | /// Enables / disables the horizontal highlight-indicator. If disabled, the indicator is not drawn. 22 | var drawHorizontalHighlightIndicatorEnabled: Bool { get set } 23 | 24 | /// Enables / disables the vertical highlight-indicator. If disabled, the indicator is not drawn. 25 | var drawVerticalHighlightIndicatorEnabled: Bool { get set } 26 | 27 | /// - returns: `true` if horizontal highlight indicator lines are enabled (drawn) 28 | var isHorizontalHighlightIndicatorEnabled: Bool { get } 29 | 30 | /// - returns: `true` if vertical highlight indicator lines are enabled (drawn) 31 | var isVerticalHighlightIndicatorEnabled: Bool { get } 32 | 33 | /// Enables / disables both vertical and horizontal highlight-indicators. 34 | /// :param: enabled 35 | func setDrawHighlightIndicators(_ enabled: Bool) 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartData 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScatterChartData.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | open class ScatterChartData: BarLineScatterCandleBubbleChartData 16 | { 17 | public override init() 18 | { 19 | super.init() 20 | } 21 | 22 | public override init(dataSets: [IChartDataSet]?) 23 | { 24 | super.init(dataSets: dataSets) 25 | } 26 | 27 | /// - returns: The maximum shape-size across all DataSets. 28 | @objc open func getGreatestShapeSize() -> CGFloat 29 | { 30 | var max = CGFloat(0.0) 31 | 32 | for set in _dataSets 33 | { 34 | let scatterDataSet = set as? IScatterChartDataSet 35 | 36 | if scatterDataSet == nil 37 | { 38 | print("ScatterChartData: Found a DataSet which is not a ScatterChartDataSet", terminator: "\n") 39 | } 40 | else 41 | { 42 | let size = scatterDataSet!.scatterShapeSize 43 | 44 | if size > max 45 | { 46 | max = size 47 | } 48 | } 49 | } 50 | 51 | return max 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Components/Description 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Description.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(ChartDescription) 16 | open class Description: ComponentBase 17 | { 18 | public override init() 19 | { 20 | #if os(tvOS) 21 | // 23 is the smallest recommended font size on the TV 22 | font = NSUIFont.systemFont(ofSize: 23) 23 | #elseif os(OSX) 24 | font = NSUIFont.systemFont(ofSize: NSUIFont.systemFontSize) 25 | #else 26 | font = NSUIFont.systemFont(ofSize: 8.0) 27 | #endif 28 | 29 | super.init() 30 | } 31 | 32 | /// The text to be shown as the description. 33 | @objc open var text: String? = "Description Label" 34 | 35 | /// Custom position for the description text in pixels on the screen. 36 | open var position: CGPoint? = nil 37 | 38 | /// The text alignment of the description text. Default RIGHT. 39 | @objc open var textAlign: NSTextAlignment = NSTextAlignment.right 40 | 41 | /// Font object used for drawing the description text. 42 | @objc open var font: NSUIFont 43 | 44 | /// Text color used for drawing the description text 45 | @objc open var textColor = NSUIColor.black 46 | } 47 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RadarChartData.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | 16 | open class RadarChartData: ChartData 17 | { 18 | @objc open var highlightColor = NSUIColor(red: 255.0/255.0, green: 187.0/255.0, blue: 115.0/255.0, alpha: 1.0) 19 | @objc open var highlightLineWidth = CGFloat(1.0) 20 | @objc open var highlightLineDashPhase = CGFloat(0.0) 21 | @objc open var highlightLineDashLengths: [CGFloat]? 22 | 23 | /// Sets labels that should be drawn around the RadarChart at the end of each web line. 24 | @objc open var labels = [String]() 25 | 26 | /// Sets the labels that should be drawn around the RadarChart at the end of each web line. 27 | open func setLabels(_ labels: String...) 28 | { 29 | self.labels = labels 30 | } 31 | 32 | public override init() 33 | { 34 | super.init() 35 | } 36 | 37 | public override init(dataSets: [IChartDataSet]?) 38 | { 39 | super.init(dataSets: dataSets) 40 | } 41 | 42 | open override func entryForHighlight(_ highlight: Highlight) -> ChartDataEntry? 43 | { 44 | return getDataSetByIndex(highlight.dataSetIndex)?.entryForIndex(Int(highlight.x)) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Formatters/IValueFormatter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IValueFormatter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | /// Interface that allows custom formatting of all values inside the chart before they are drawn to the screen. 15 | /// 16 | /// Simply create your own formatting class and let it implement ValueFormatter. Then override the stringForValue() 17 | /// method and return whatever you want. 18 | 19 | @objc(IChartValueFormatter) 20 | public protocol IValueFormatter: class 21 | { 22 | 23 | /// Called when a value (from labels inside the chart) is formatted before being drawn. 24 | /// 25 | /// For performance reasons, avoid excessive calculations and memory allocations inside this method. 26 | /// 27 | /// - Parameters: 28 | /// - value: The value to be formatted 29 | /// - dataSetIndex: The index of the DataSet the entry in focus belongs to 30 | /// - viewPortHandler: provides information about the current chart state (scale, translation, ...) 31 | /// - Returns: The formatted label ready to be drawn 32 | func stringForValue(_ value: Double, 33 | entry: ChartDataEntry, 34 | dataSetIndex: Int, 35 | viewPortHandler: ViewPortHandler?) -> String 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Components/Description.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Description.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | #if canImport(UIKit) 16 | import UIKit 17 | #endif 18 | 19 | #if canImport(Cocoa) 20 | import Cocoa 21 | #endif 22 | 23 | @objc(ChartDescription) 24 | open class Description: ComponentBase 25 | { 26 | public override init() 27 | { 28 | #if os(tvOS) 29 | // 23 is the smallest recommended font size on the TV 30 | font = .systemFont(ofSize: 23) 31 | #elseif os(OSX) 32 | font = .systemFont(ofSize: NSUIFont.systemFontSize) 33 | #else 34 | font = .systemFont(ofSize: 8.0) 35 | #endif 36 | 37 | super.init() 38 | } 39 | 40 | /// The text to be shown as the description. 41 | @objc open var text: String? 42 | 43 | /// Custom position for the description text in pixels on the screen. 44 | open var position: CGPoint? = nil 45 | 46 | /// The text alignment of the description text. Default RIGHT. 47 | @objc open var textAlign: NSTextAlignment = NSTextAlignment.right 48 | 49 | /// Font object used for drawing the description text. 50 | @objc open var font: NSUIFont 51 | 52 | /// Text color used for drawing the description text 53 | @objc open var textColor = NSUIColor.labelOrBlack 54 | } 55 | -------------------------------------------------------------------------------- /LineChartExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/IBarChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBarChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol IBarChartDataSet: IBarLineScatterCandleBubbleChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | // MARK: - Styling functions and accessors 21 | 22 | /// `true` if this DataSet is stacked (stacksize > 1) or not. 23 | var isStacked: Bool { get } 24 | 25 | /// The maximum number of bars that can be stacked upon another in this DataSet. 26 | var stackSize: Int { get } 27 | 28 | /// the color used for drawing the bar-shadows. The bar shadows is a surface behind the bar that indicates the maximum value 29 | var barShadowColor: NSUIColor { get set } 30 | 31 | /// the width used for drawing borders around the bars. If borderWidth == 0, no border will be drawn. 32 | var barBorderWidth : CGFloat { get set } 33 | 34 | /// the color drawing borders around the bars. 35 | var barBorderColor: NSUIColor { get set } 36 | 37 | /// the alpha value (transparency) that is used for drawing the highlight indicator bar. min = 0.0 (fully transparent), max = 1.0 (fully opaque) 38 | var highlightAlpha: CGFloat { get set } 39 | 40 | /// array of labels used to describe the different values of the stacked bars 41 | var stackLabels: [String] { get set } 42 | } 43 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ILineRadarChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol ILineRadarChartDataSet: ILineScatterCandleRadarChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | // MARK: - Styling functions and accessors 21 | 22 | /// The color that is used for filling the line surface area. 23 | var fillColor: NSUIColor { get set } 24 | 25 | /// - Returns: The object that is used for filling the area below the line. 26 | /// **default**: nil 27 | var fill: Fill? { get set } 28 | 29 | /// The alpha value that is used for filling the line surface. 30 | /// **default**: 0.33 31 | var fillAlpha: CGFloat { get set } 32 | 33 | /// line width of the chart (min = 0.0, max = 10) 34 | /// 35 | /// **default**: 1 36 | var lineWidth: CGFloat { get set } 37 | 38 | /// Set to `true` if the DataSet should be drawn filled (surface), and not just as a line. 39 | /// Disabling this will give great performance boost. 40 | /// Please note that this method uses the path clipping for drawing the filled area (with images, gradients and layers). 41 | var drawFilledEnabled: Bool { get set } 42 | 43 | /// `true` if filled drawing is enabled, `false` if not 44 | var isDrawFilledEnabled: Bool { get } 45 | } 46 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Formatters/IndexAxisValueFormatter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IndexAxisValueFormatter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | /// This formatter is used for passing an array of x-axis labels, on whole x steps. 15 | @objc(ChartIndexAxisValueFormatter) 16 | open class IndexAxisValueFormatter: NSObject, IAxisValueFormatter 17 | { 18 | private var _values: [String] = [String]() 19 | private var _valueCount: Int = 0 20 | 21 | @objc public var values: [String] 22 | { 23 | get 24 | { 25 | return _values 26 | } 27 | set 28 | { 29 | _values = newValue 30 | _valueCount = _values.count 31 | } 32 | } 33 | 34 | public override init() 35 | { 36 | super.init() 37 | 38 | } 39 | 40 | @objc public init(values: [String]) 41 | { 42 | super.init() 43 | 44 | self.values = values 45 | } 46 | 47 | @objc public static func with(values: [String]) -> IndexAxisValueFormatter? 48 | { 49 | return IndexAxisValueFormatter(values: values) 50 | } 51 | 52 | open func stringForValue(_ value: Double, 53 | axis: AxisBase?) -> String 54 | { 55 | let index = Int(value.rounded()) 56 | guard values.indices.contains(index), index == Int(value) else { return "" } 57 | return _values[index] 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Formatters/DefaultFillFormatter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultFillFormatter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | /// Default formatter that calculates the position of the filled line. 16 | @objc(ChartDefaultFillFormatter) 17 | open class DefaultFillFormatter: NSObject, IFillFormatter 18 | { 19 | public typealias Block = ( 20 | _ dataSet: ILineChartDataSet, 21 | _ dataProvider: LineChartDataProvider) -> CGFloat 22 | 23 | @objc open var block: Block? 24 | 25 | public override init() { } 26 | 27 | @objc public init(block: @escaping Block) 28 | { 29 | self.block = block 30 | } 31 | 32 | @objc public static func with(block: @escaping Block) -> DefaultFillFormatter? 33 | { 34 | return DefaultFillFormatter(block: block) 35 | } 36 | 37 | open func getFillLinePosition( 38 | dataSet: ILineChartDataSet, 39 | dataProvider: LineChartDataProvider) -> CGFloat 40 | { 41 | guard block == nil else { return block!(dataSet, dataProvider) } 42 | var fillMin: CGFloat = 0.0 43 | 44 | if dataSet.yMax > 0.0 && dataSet.yMin < 0.0 45 | { 46 | fillMin = 0.0 47 | } 48 | else if let data = dataProvider.data 49 | { 50 | let max = data.yMax > 0.0 ? 0.0 : dataProvider.chartYMax 51 | let min = data.yMin < 0.0 ? 0.0 : dataProvider.chartYMin 52 | 53 | fillMin = CGFloat(dataSet.yMin >= 0.0 ? min : max) 54 | } 55 | 56 | return fillMin 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/LineRadarRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineRadarRenderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(LineRadarChartRenderer) 16 | open class LineRadarRenderer: LineScatterCandleRadarRenderer 17 | { 18 | public override init(animator: Animator, viewPortHandler: ViewPortHandler) 19 | { 20 | super.init(animator: animator, viewPortHandler: viewPortHandler) 21 | } 22 | 23 | /// Draws the provided path in filled mode with the provided drawable. 24 | @objc open func drawFilledPath(context: CGContext, path: CGPath, fill: Fill, fillAlpha: CGFloat) 25 | { 26 | 27 | context.saveGState() 28 | context.beginPath() 29 | context.addPath(path) 30 | 31 | // filled is usually drawn with less alpha 32 | context.setAlpha(fillAlpha) 33 | 34 | fill.fillPath(context: context, rect: viewPortHandler.contentRect) 35 | 36 | context.restoreGState() 37 | } 38 | 39 | /// Draws the provided path in filled mode with the provided color and alpha. 40 | @objc open func drawFilledPath(context: CGContext, path: CGPath, fillColor: NSUIColor, fillAlpha: CGFloat) 41 | { 42 | context.saveGState() 43 | context.beginPath() 44 | context.addPath(path) 45 | 46 | // filled is usually drawn with less alpha 47 | context.setAlpha(fillAlpha) 48 | 49 | context.setFillColor(fillColor.cgColor) 50 | context.fillPath() 51 | 52 | context.restoreGState() 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BubbleChartDataSet.swift 3 | // Charts 4 | // 5 | // Bubble chart implementation: 6 | // Copyright 2015 Pierre-Marc Airoldi 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | 16 | open class BubbleChartDataSet: BarLineScatterCandleBubbleChartDataSet, IBubbleChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | internal var _maxSize = CGFloat(0.0) 21 | 22 | open var maxSize: CGFloat { return _maxSize } 23 | @objc open var normalizeSizeEnabled: Bool = true 24 | open var isNormalizeSizeEnabled: Bool { return normalizeSizeEnabled } 25 | 26 | open override func calcMinMax(entry e: ChartDataEntry) 27 | { 28 | guard let e = e as? BubbleChartDataEntry 29 | else { return } 30 | 31 | super.calcMinMax(entry: e) 32 | 33 | let size = e.size 34 | 35 | if size > _maxSize 36 | { 37 | _maxSize = size 38 | } 39 | } 40 | 41 | // MARK: - Styling functions and accessors 42 | 43 | /// Sets/gets the width of the circle that surrounds the bubble when highlighted 44 | open var highlightCircleWidth: CGFloat = 2.5 45 | 46 | // MARK: - NSCopying 47 | 48 | open override func copy(with zone: NSZone? = nil) -> Any 49 | { 50 | let copy = super.copy(with: zone) as! BubbleChartDataSet 51 | copy._xMin = _xMin 52 | copy._xMax = _xMax 53 | copy._maxSize = _maxSize 54 | copy.normalizeSizeEnabled = normalizeSizeEnabled 55 | copy.highlightCircleWidth = highlightCircleWidth 56 | return copy 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/LineScatterCandleRadarRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineScatterCandleRadarRenderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(LineScatterCandleRadarChartRenderer) 16 | open class LineScatterCandleRadarRenderer: BarLineScatterCandleBubbleRenderer 17 | { 18 | public override init(animator: Animator, viewPortHandler: ViewPortHandler) 19 | { 20 | super.init(animator: animator, viewPortHandler: viewPortHandler) 21 | } 22 | 23 | /// Draws vertical & horizontal highlight-lines if enabled. 24 | /// :param: context 25 | /// :param: points 26 | /// :param: horizontal 27 | /// :param: vertical 28 | @objc open func drawHighlightLines(context: CGContext, point: CGPoint, set: ILineScatterCandleRadarChartDataSet) 29 | { 30 | 31 | // draw vertical highlight lines 32 | if set.isVerticalHighlightIndicatorEnabled 33 | { 34 | context.beginPath() 35 | context.move(to: CGPoint(x: point.x, y: viewPortHandler.contentTop)) 36 | context.addLine(to: CGPoint(x: point.x, y: viewPortHandler.contentBottom)) 37 | context.strokePath() 38 | } 39 | 40 | // draw horizontal highlight lines 41 | if set.isHorizontalHighlightIndicatorEnabled 42 | { 43 | context.beginPath() 44 | context.move(to: CGPoint(x: viewPortHandler.contentLeft, y: point.y)) 45 | context.addLine(to: CGPoint(x: viewPortHandler.contentRight, y: point.y)) 46 | context.strokePath() 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /LineChartExample/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 | 27 | 28 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RadarChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | 16 | open class RadarChartDataSet: LineRadarChartDataSet, IRadarChartDataSet 17 | { 18 | private func initialize() 19 | { 20 | self.valueFont = NSUIFont.systemFont(ofSize: 13.0) 21 | } 22 | 23 | public required init() 24 | { 25 | super.init() 26 | initialize() 27 | } 28 | 29 | public required override init(entries: [ChartDataEntry]?, label: String?) 30 | { 31 | super.init(entries: entries, label: label) 32 | initialize() 33 | } 34 | 35 | // MARK: - Data functions and accessors 36 | 37 | // MARK: - Styling functions and accessors 38 | 39 | /// flag indicating whether highlight circle should be drawn or not 40 | /// **default**: false 41 | open var drawHighlightCircleEnabled: Bool = false 42 | 43 | /// `true` if highlight circle should be drawn, `false` ifnot 44 | open var isDrawHighlightCircleEnabled: Bool { return drawHighlightCircleEnabled } 45 | 46 | open var highlightCircleFillColor: NSUIColor? = NSUIColor.white 47 | 48 | /// The stroke color for highlight circle. 49 | /// If `nil`, the color of the dataset is taken. 50 | open var highlightCircleStrokeColor: NSUIColor? 51 | 52 | open var highlightCircleStrokeAlpha: CGFloat = 0.3 53 | 54 | open var highlightCircleInnerRadius: CGFloat = 3.0 55 | 56 | open var highlightCircleOuterRadius: CGFloat = 4.0 57 | 58 | open var highlightCircleStrokeWidth: CGFloat = 2.0 59 | } 60 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/RadarChartDataSet 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RadarChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | 16 | open class RadarChartDataSet: LineRadarChartDataSet, IRadarChartDataSet 17 | { 18 | fileprivate func initialize() 19 | { 20 | self.valueFont = NSUIFont.systemFont(ofSize: 13.0) 21 | } 22 | 23 | public required init() 24 | { 25 | super.init() 26 | initialize() 27 | } 28 | 29 | public required override init(values: [ChartDataEntry]?, label: String?) 30 | { 31 | super.init(values: values, label: label) 32 | initialize() 33 | } 34 | 35 | // MARK: - Data functions and accessors 36 | 37 | // MARK: - Styling functions and accessors 38 | 39 | /// flag indicating whether highlight circle should be drawn or not 40 | /// **default**: false 41 | open var drawHighlightCircleEnabled: Bool = false 42 | 43 | /// - returns: `true` if highlight circle should be drawn, `false` ifnot 44 | open var isDrawHighlightCircleEnabled: Bool { return drawHighlightCircleEnabled } 45 | 46 | open var highlightCircleFillColor: NSUIColor? = NSUIColor.white 47 | 48 | /// The stroke color for highlight circle. 49 | /// If `nil`, the color of the dataset is taken. 50 | open var highlightCircleStrokeColor: NSUIColor? 51 | 52 | open var highlightCircleStrokeAlpha: CGFloat = 0.3 53 | 54 | open var highlightCircleInnerRadius: CGFloat = 3.0 55 | 56 | open var highlightCircleOuterRadius: CGFloat = 4.0 57 | 58 | open var highlightCircleStrokeWidth: CGFloat = 2.0 59 | } 60 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Components/IMarker.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChartMarker.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(IChartMarker) 16 | public protocol IMarker: class 17 | { 18 | /// - Returns: The desired (general) offset you wish the IMarker to have on the x-axis. 19 | /// By returning x: -(width / 2) you will center the IMarker horizontally. 20 | /// By returning y: -(height / 2) you will center the IMarker vertically. 21 | var offset: CGPoint { get } 22 | 23 | /// - Parameters: 24 | /// - point: This is the point at which the marker wants to be drawn. You can adjust the offset conditionally based on this argument. 25 | /// - Returns: The offset for drawing at the specific `point`. 26 | /// This allows conditional adjusting of the Marker position. 27 | /// If you have no adjustments to make, return self.offset(). 28 | func offsetForDrawing(atPoint: CGPoint) -> CGPoint 29 | 30 | /// This method enables a custom IMarker to update it's content every time the IMarker is redrawn according to the data entry it points to. 31 | /// 32 | /// - Parameters: 33 | /// - entry: The Entry the IMarker belongs to. This can also be any subclass of Entry, like BarEntry or CandleEntry, simply cast it at runtime. 34 | /// - highlight: The highlight object contains information about the highlighted value such as it's dataset-index, the selected range or stack-index (only stacked bar entries). 35 | func refreshContent(entry: ChartDataEntry, highlight: Highlight) 36 | 37 | /// Draws the IMarker on the given position on the given context 38 | func draw(context: CGContext, point: CGPoint) 39 | } 40 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Highlight/PieRadarHighlighter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PieRadarHighlighter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(PieRadarChartHighlighter) 16 | open class PieRadarHighlighter: ChartHighlighter 17 | { 18 | open override func getHighlight(x: CGFloat, y: CGFloat) -> Highlight? 19 | { 20 | guard let chart = self.chart as? PieRadarChartViewBase else { return nil } 21 | 22 | let touchDistanceToCenter = chart.distanceToCenter(x: x, y: y) 23 | 24 | // check if a slice was touched 25 | guard touchDistanceToCenter <= chart.radius else 26 | { 27 | // if no slice was touched, highlight nothing 28 | return nil 29 | } 30 | 31 | var angle = chart.angleForPoint(x: x ,y: y) 32 | 33 | if chart is PieChartView 34 | { 35 | angle /= CGFloat(chart.chartAnimator.phaseY) 36 | } 37 | 38 | let index = chart.indexForAngle(angle) 39 | 40 | // check if the index could be found 41 | if index < 0 || index >= chart.data?.maxEntryCountSet?.entryCount ?? 0 42 | { 43 | return nil 44 | } 45 | else 46 | { 47 | return closestHighlight(index: index, x: x, y: y) 48 | } 49 | 50 | } 51 | 52 | /// - Parameters: 53 | /// - index: 54 | /// - x: 55 | /// - y: 56 | /// - Returns: The closest Highlight object of the given objects based on the touch position inside the chart. 57 | @objc open func closestHighlight(index: Int, x: CGFloat, y: CGFloat) -> Highlight? 58 | { 59 | fatalError("closestHighlight(index, x, y) cannot be called on PieRadarChartHighlighter") 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/ICandleChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ICandleChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol ICandleChartDataSet: ILineScatterCandleRadarChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | // MARK: - Styling functions and accessors 21 | 22 | /// the space that is left out on the left and right side of each candle, 23 | /// **default**: 0.1 (10%), max 0.45, min 0.0 24 | var barSpace: CGFloat { get set } 25 | 26 | /// should the candle bars show? 27 | /// when false, only "ticks" will show 28 | /// 29 | /// **default**: true 30 | var showCandleBar: Bool { get set } 31 | 32 | /// the width of the candle-shadow-line in pixels. 33 | /// 34 | /// **default**: 3.0 35 | var shadowWidth: CGFloat { get set } 36 | 37 | /// the color of the shadow line 38 | var shadowColor: NSUIColor? { get set } 39 | 40 | /// use candle color for the shadow 41 | var shadowColorSameAsCandle: Bool { get set } 42 | 43 | /// Is the shadow color same as the candle color? 44 | var isShadowColorSameAsCandle: Bool { get } 45 | 46 | /// color for open == close 47 | var neutralColor: NSUIColor? { get set } 48 | 49 | /// color for open > close 50 | var increasingColor: NSUIColor? { get set } 51 | 52 | /// color for open < close 53 | var decreasingColor: NSUIColor? { get set } 54 | 55 | /// Are increasing values drawn as filled? 56 | var increasingFilled: Bool { get set } 57 | 58 | /// Are increasing values drawn as filled? 59 | var isIncreasingFilled: Bool { get } 60 | 61 | /// Are decreasing values drawn as filled? 62 | var decreasingFilled: Bool { get set } 63 | 64 | /// Are decreasing values drawn as filled? 65 | var isDecreasingFilled: Bool { get } 66 | } 67 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineScatterCandleRadarChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | 15 | open class LineScatterCandleRadarChartDataSet: BarLineScatterCandleBubbleChartDataSet, ILineScatterCandleRadarChartDataSet 16 | { 17 | // MARK: - Data functions and accessors 18 | 19 | // MARK: - Styling functions and accessors 20 | 21 | /// Enables / disables the horizontal highlight-indicator. If disabled, the indicator is not drawn. 22 | open var drawHorizontalHighlightIndicatorEnabled = true 23 | 24 | /// Enables / disables the vertical highlight-indicator. If disabled, the indicator is not drawn. 25 | open var drawVerticalHighlightIndicatorEnabled = true 26 | 27 | /// `true` if horizontal highlight indicator lines are enabled (drawn) 28 | open var isHorizontalHighlightIndicatorEnabled: Bool { return drawHorizontalHighlightIndicatorEnabled } 29 | 30 | /// `true` if vertical highlight indicator lines are enabled (drawn) 31 | open var isVerticalHighlightIndicatorEnabled: Bool { return drawVerticalHighlightIndicatorEnabled } 32 | 33 | /// Enables / disables both vertical and horizontal highlight-indicators. 34 | /// :param: enabled 35 | open func setDrawHighlightIndicators(_ enabled: Bool) 36 | { 37 | drawHorizontalHighlightIndicatorEnabled = enabled 38 | drawVerticalHighlightIndicatorEnabled = enabled 39 | } 40 | 41 | // MARK: NSCopying 42 | 43 | open override func copy(with zone: NSZone? = nil) -> Any 44 | { 45 | let copy = super.copy(with: zone) as! LineScatterCandleRadarChartDataSet 46 | copy.drawHorizontalHighlightIndicatorEnabled = drawHorizontalHighlightIndicatorEnabled 47 | copy.drawVerticalHighlightIndicatorEnabled = drawVerticalHighlightIndicatorEnabled 48 | return copy 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineScatterCandleRadarChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | 15 | open class LineScatterCandleRadarChartDataSet: BarLineScatterCandleBubbleChartDataSet, ILineScatterCandleRadarChartDataSet 16 | { 17 | // MARK: - Data functions and accessors 18 | 19 | // MARK: - Styling functions and accessors 20 | 21 | /// Enables / disables the horizontal highlight-indicator. If disabled, the indicator is not drawn. 22 | open var drawHorizontalHighlightIndicatorEnabled = true 23 | 24 | /// Enables / disables the vertical highlight-indicator. If disabled, the indicator is not drawn. 25 | open var drawVerticalHighlightIndicatorEnabled = true 26 | 27 | /// - returns: `true` if horizontal highlight indicator lines are enabled (drawn) 28 | open var isHorizontalHighlightIndicatorEnabled: Bool { return drawHorizontalHighlightIndicatorEnabled } 29 | 30 | /// - returns: `true` if vertical highlight indicator lines are enabled (drawn) 31 | open var isVerticalHighlightIndicatorEnabled: Bool { return drawVerticalHighlightIndicatorEnabled } 32 | 33 | /// Enables / disables both vertical and horizontal highlight-indicators. 34 | /// :param: enabled 35 | open func setDrawHighlightIndicators(_ enabled: Bool) 36 | { 37 | drawHorizontalHighlightIndicatorEnabled = enabled 38 | drawVerticalHighlightIndicatorEnabled = enabled 39 | } 40 | 41 | // MARK: NSCopying 42 | 43 | open override func copyWithZone(_ zone: NSZone?) -> AnyObject 44 | { 45 | let copy = super.copyWithZone(zone) as! LineScatterCandleRadarChartDataSet 46 | copy.drawHorizontalHighlightIndicatorEnabled = drawHorizontalHighlightIndicatorEnabled 47 | copy.drawVerticalHighlightIndicatorEnabled = drawVerticalHighlightIndicatorEnabled 48 | return copy 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Components/ChartLimitLine.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChartLimitLine.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | 16 | /// The limit line is an additional feature for all Line, Bar and ScatterCharts. 17 | /// It allows the displaying of an additional line in the chart that marks a certain maximum / limit on the specified axis (x- or y-axis). 18 | open class ChartLimitLine: ComponentBase 19 | { 20 | @objc(ChartLimitLabelPosition) 21 | public enum LabelPosition: Int 22 | { 23 | case topLeft 24 | case topRight 25 | case bottomLeft 26 | case bottomRight 27 | } 28 | 29 | /// limit / maximum (the y-value or xIndex) 30 | @objc open var limit = Double(0.0) 31 | 32 | private var _lineWidth = CGFloat(2.0) 33 | @objc open var lineColor = NSUIColor(red: 237.0/255.0, green: 91.0/255.0, blue: 91.0/255.0, alpha: 1.0) 34 | @objc open var lineDashPhase = CGFloat(0.0) 35 | @objc open var lineDashLengths: [CGFloat]? 36 | 37 | @objc open var valueTextColor = NSUIColor.labelOrBlack 38 | @objc open var valueFont = NSUIFont.systemFont(ofSize: 13.0) 39 | 40 | @objc open var drawLabelEnabled = true 41 | @objc open var label = "" 42 | @objc open var labelPosition = LabelPosition.topRight 43 | 44 | public override init() 45 | { 46 | super.init() 47 | } 48 | 49 | @objc public init(limit: Double) 50 | { 51 | super.init() 52 | self.limit = limit 53 | } 54 | 55 | @objc public init(limit: Double, label: String) 56 | { 57 | super.init() 58 | self.limit = limit 59 | self.label = label 60 | } 61 | 62 | /// set the line width of the chart (min = 0.2, max = 12); default 2 63 | @objc open var lineWidth: CGFloat 64 | { 65 | get 66 | { 67 | return _lineWidth 68 | } 69 | set 70 | { 71 | _lineWidth = newValue.clamped(to: 0.2...12) 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IPieChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | #if !os(OSX) 16 | import UIKit 17 | #endif 18 | 19 | @objc 20 | public protocol IPieChartDataSet: IChartDataSet 21 | { 22 | // MARK: - Styling functions and accessors 23 | 24 | /// the space in pixels between the pie-slices 25 | /// **default**: 0 26 | /// **maximum**: 20 27 | var sliceSpace: CGFloat { get set } 28 | 29 | /// When enabled, slice spacing will be 0.0 when the smallest value is going to be smaller than the slice spacing itself. 30 | var automaticallyDisableSliceSpacing: Bool { get set } 31 | 32 | /// indicates the selection distance of a pie slice 33 | var selectionShift: CGFloat { get set } 34 | 35 | var xValuePosition: PieChartDataSet.ValuePosition { get set } 36 | var yValuePosition: PieChartDataSet.ValuePosition { get set } 37 | 38 | /// When valuePosition is OutsideSlice, indicates line color 39 | var valueLineColor: NSUIColor? { get set } 40 | 41 | /// When valuePosition is OutsideSlice, indicates line width 42 | var valueLineWidth: CGFloat { get set } 43 | 44 | /// When valuePosition is OutsideSlice, indicates offset as percentage out of the slice size 45 | var valueLinePart1OffsetPercentage: CGFloat { get set } 46 | 47 | /// When valuePosition is OutsideSlice, indicates length of first half of the line 48 | var valueLinePart1Length: CGFloat { get set } 49 | 50 | /// When valuePosition is OutsideSlice, indicates length of second half of the line 51 | var valueLinePart2Length: CGFloat { get set } 52 | 53 | /// When valuePosition is OutsideSlice, this allows variable line length 54 | var valueLineVariableLength: Bool { get set } 55 | 56 | /// the font for the slice-text labels 57 | var entryLabelFont: NSUIFont? { get set } 58 | 59 | /// the color for the slice-text labels 60 | var entryLabelColor: NSUIColor? { get set } 61 | } 62 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/osiansmith.xcuserdatad/xcschemes/Charts.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /LineChartExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // LineChartExample 4 | // 5 | // Created by Osian on 13/07/2017. 6 | // Copyright © 2017 Osian. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/osiansmith.xcuserdatad/xcschemes/Pods-LineChartExample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/osiansmith.xcuserdatad/xcschemes/Pods-LineChartExampleTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/osiansmith.xcuserdatad/xcschemes/Pods-LineChartExampleUITests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Highlight/HorizontalBarHighlighter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HorizontalBarHighlighter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(HorizontalBarChartHighlighter) 16 | open class HorizontalBarHighlighter: BarHighlighter 17 | { 18 | open override func getHighlight(x: CGFloat, y: CGFloat) -> Highlight? 19 | { 20 | guard let barData = self.chart?.data as? BarChartData else { return nil } 21 | 22 | let pos = getValsForTouch(x: y, y: x) 23 | guard let high = getHighlight(xValue: Double(pos.y), x: y, y: x) else { return nil } 24 | 25 | if let set = barData.getDataSetByIndex(high.dataSetIndex) as? IBarChartDataSet, 26 | set.isStacked 27 | { 28 | return getStackedHighlight(high: high, 29 | set: set, 30 | xValue: Double(pos.y), 31 | yValue: Double(pos.x)) 32 | } 33 | 34 | return high 35 | } 36 | 37 | internal override func buildHighlights( 38 | dataSet set: IChartDataSet, 39 | dataSetIndex: Int, 40 | xValue: Double, 41 | rounding: ChartDataSetRounding) -> [Highlight] 42 | { 43 | guard let chart = self.chart as? BarLineScatterCandleBubbleChartDataProvider else { return [] } 44 | 45 | var entries = set.entriesForXValue(xValue) 46 | if entries.count == 0, let closest = set.entryForXValue(xValue, closestToY: .nan, rounding: rounding) 47 | { 48 | // Try to find closest x-value and take all entries for that x-value 49 | entries = set.entriesForXValue(closest.x) 50 | } 51 | 52 | return entries.map { e in 53 | let px = chart.getTransformer(forAxis: set.axisDependency) 54 | .pixelForValues(x: e.y, y: e.x) 55 | return Highlight(x: e.x, y: e.y, xPx: px.x, yPx: px.y, dataSetIndex: dataSetIndex, axis: set.axisDependency) 56 | } 57 | } 58 | 59 | internal override func getDistance(x1: CGFloat, y1: CGFloat, x2: CGFloat, y2: CGFloat) -> CGFloat 60 | { 61 | return abs(y1 - y2) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Jobs/ZoomViewJob.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ZoomViewJob.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(ZoomChartViewJob) 16 | open class ZoomViewJob: ViewPortJob 17 | { 18 | internal var scaleX: CGFloat = 0.0 19 | internal var scaleY: CGFloat = 0.0 20 | internal var axisDependency: YAxis.AxisDependency = .left 21 | 22 | @objc public init( 23 | viewPortHandler: ViewPortHandler, 24 | scaleX: CGFloat, 25 | scaleY: CGFloat, 26 | xValue: Double, 27 | yValue: Double, 28 | transformer: Transformer, 29 | axis: YAxis.AxisDependency, 30 | view: ChartViewBase) 31 | { 32 | super.init( 33 | viewPortHandler: viewPortHandler, 34 | xValue: xValue, 35 | yValue: yValue, 36 | transformer: transformer, 37 | view: view) 38 | 39 | self.scaleX = scaleX 40 | self.scaleY = scaleY 41 | self.axisDependency = axis 42 | } 43 | 44 | open override func doJob() 45 | { 46 | guard 47 | let viewPortHandler = viewPortHandler, 48 | let transformer = transformer, 49 | let view = view 50 | else { return } 51 | 52 | var matrix = viewPortHandler.setZoom(scaleX: scaleX, scaleY: scaleY) 53 | viewPortHandler.refresh(newMatrix: matrix, chart: view, invalidate: false) 54 | 55 | let yValsInView = (view as! BarLineChartViewBase).getAxis(axisDependency).axisRange / Double(viewPortHandler.scaleY) 56 | let xValsInView = (view as! BarLineChartViewBase).xAxis.axisRange / Double(viewPortHandler.scaleX) 57 | 58 | var pt = CGPoint( 59 | x: CGFloat(xValue - xValsInView / 2.0), 60 | y: CGFloat(yValue + yValsInView / 2.0) 61 | ) 62 | 63 | transformer.pointValueToPixel(&pt) 64 | 65 | matrix = viewPortHandler.translate(pt: pt) 66 | viewPortHandler.refresh(newMatrix: matrix, chart: view, invalidate: false) 67 | 68 | (view as! BarLineChartViewBase).calculateOffsets() 69 | view.setNeedsDisplay() 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SquareShapeRenderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | import Foundation 12 | import CoreGraphics 13 | 14 | open class SquareShapeRenderer : NSObject, IShapeRenderer 15 | { 16 | open func renderShape( 17 | context: CGContext, 18 | dataSet: IScatterChartDataSet, 19 | viewPortHandler: ViewPortHandler, 20 | point: CGPoint, 21 | color: NSUIColor) 22 | { 23 | let shapeSize = dataSet.scatterShapeSize 24 | let shapeHalf = shapeSize / 2.0 25 | let shapeHoleSizeHalf = dataSet.scatterShapeHoleRadius 26 | let shapeHoleSize = shapeHoleSizeHalf * 2.0 27 | let shapeHoleColor = dataSet.scatterShapeHoleColor 28 | let shapeStrokeSize = (shapeSize - shapeHoleSize) / 2.0 29 | let shapeStrokeSizeHalf = shapeStrokeSize / 2.0 30 | 31 | if shapeHoleSize > 0.0 32 | { 33 | context.setStrokeColor(color.cgColor) 34 | context.setLineWidth(shapeStrokeSize) 35 | var rect = CGRect() 36 | rect.origin.x = point.x - shapeHoleSizeHalf - shapeStrokeSizeHalf 37 | rect.origin.y = point.y - shapeHoleSizeHalf - shapeStrokeSizeHalf 38 | rect.size.width = shapeHoleSize + shapeStrokeSize 39 | rect.size.height = shapeHoleSize + shapeStrokeSize 40 | context.stroke(rect) 41 | 42 | if let shapeHoleColor = shapeHoleColor 43 | { 44 | context.setFillColor(shapeHoleColor.cgColor) 45 | rect.origin.x = point.x - shapeHoleSizeHalf 46 | rect.origin.y = point.y - shapeHoleSizeHalf 47 | rect.size.width = shapeHoleSize 48 | rect.size.height = shapeHoleSize 49 | context.fill(rect) 50 | } 51 | } 52 | else 53 | { 54 | context.setFillColor(color.cgColor) 55 | var rect = CGRect() 56 | rect.origin.x = point.x - shapeHalf 57 | rect.origin.y = point.y - shapeHalf 58 | rect.size.width = shapeSize 59 | rect.size.height = shapeSize 60 | context.fill(rect) 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/IPieChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IPieChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc 16 | public protocol IPieChartDataSet: IChartDataSet 17 | { 18 | // MARK: - Styling functions and accessors 19 | 20 | /// the space in pixels between the pie-slices 21 | /// **default**: 0 22 | /// **maximum**: 20 23 | var sliceSpace: CGFloat { get set } 24 | 25 | /// When enabled, slice spacing will be 0.0 when the smallest value is going to be smaller than the slice spacing itself. 26 | var automaticallyDisableSliceSpacing: Bool { get set } 27 | 28 | /// indicates the selection distance of a pie slice 29 | var selectionShift: CGFloat { get set } 30 | 31 | var xValuePosition: PieChartDataSet.ValuePosition { get set } 32 | var yValuePosition: PieChartDataSet.ValuePosition { get set } 33 | 34 | /// When valuePosition is OutsideSlice, indicates line color 35 | var valueLineColor: NSUIColor? { get set } 36 | 37 | /// When valuePosition is OutsideSlice and enabled, line will have the same color as the slice 38 | var useValueColorForLine: Bool { get set } 39 | 40 | /// When valuePosition is OutsideSlice, indicates line width 41 | var valueLineWidth: CGFloat { get set } 42 | 43 | /// When valuePosition is OutsideSlice, indicates offset as percentage out of the slice size 44 | var valueLinePart1OffsetPercentage: CGFloat { get set } 45 | 46 | /// When valuePosition is OutsideSlice, indicates length of first half of the line 47 | var valueLinePart1Length: CGFloat { get set } 48 | 49 | /// When valuePosition is OutsideSlice, indicates length of second half of the line 50 | var valueLinePart2Length: CGFloat { get set } 51 | 52 | /// When valuePosition is OutsideSlice, this allows variable line length 53 | var valueLineVariableLength: Bool { get set } 54 | 55 | /// the font for the slice-text labels 56 | var entryLabelFont: NSUIFont? { get set } 57 | 58 | /// the color for the slice-text labels 59 | var entryLabelColor: NSUIColor? { get set } 60 | 61 | /// get/sets the color for the highlighted sector 62 | var highlightColor: NSUIColor? { get set } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/Scatter/CircleShapeRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CircleShapeRenderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | import Foundation 12 | import CoreGraphics 13 | 14 | open class CircleShapeRenderer : NSObject, IShapeRenderer 15 | { 16 | open func renderShape( 17 | context: CGContext, 18 | dataSet: IScatterChartDataSet, 19 | viewPortHandler: ViewPortHandler, 20 | point: CGPoint, 21 | color: NSUIColor) 22 | { 23 | let shapeSize = dataSet.scatterShapeSize 24 | let shapeHalf = shapeSize / 2.0 25 | let shapeHoleSizeHalf = dataSet.scatterShapeHoleRadius 26 | let shapeHoleSize = shapeHoleSizeHalf * 2.0 27 | let shapeHoleColor = dataSet.scatterShapeHoleColor 28 | let shapeStrokeSize = (shapeSize - shapeHoleSize) / 2.0 29 | let shapeStrokeSizeHalf = shapeStrokeSize / 2.0 30 | 31 | if shapeHoleSize > 0.0 32 | { 33 | context.setStrokeColor(color.cgColor) 34 | context.setLineWidth(shapeStrokeSize) 35 | var rect = CGRect() 36 | rect.origin.x = point.x - shapeHoleSizeHalf - shapeStrokeSizeHalf 37 | rect.origin.y = point.y - shapeHoleSizeHalf - shapeStrokeSizeHalf 38 | rect.size.width = shapeHoleSize + shapeStrokeSize 39 | rect.size.height = shapeHoleSize + shapeStrokeSize 40 | context.strokeEllipse(in: rect) 41 | 42 | if let shapeHoleColor = shapeHoleColor 43 | { 44 | context.setFillColor(shapeHoleColor.cgColor) 45 | rect.origin.x = point.x - shapeHoleSizeHalf 46 | rect.origin.y = point.y - shapeHoleSizeHalf 47 | rect.size.width = shapeHoleSize 48 | rect.size.height = shapeHoleSize 49 | context.fillEllipse(in: rect) 50 | } 51 | } 52 | else 53 | { 54 | context.setFillColor(color.cgColor) 55 | var rect = CGRect() 56 | rect.origin.x = point.x - shapeHalf 57 | rect.origin.y = point.y - shapeHalf 58 | rect.size.width = shapeSize 59 | rect.size.height = shapeSize 60 | context.fillEllipse(in: rect) 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BubbleDataEntry.swift 3 | // Charts 4 | // 5 | // Bubble chart implementation: 6 | // Copyright 2015 Pierre-Marc Airoldi 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | open class BubbleChartDataEntry: ChartDataEntry 16 | { 17 | /// The size of the bubble. 18 | @objc open var size = CGFloat(0.0) 19 | 20 | public required init() 21 | { 22 | super.init() 23 | } 24 | 25 | /// - Parameters: 26 | /// - x: The index on the x-axis. 27 | /// - y: The value on the y-axis. 28 | /// - size: The size of the bubble. 29 | @objc public init(x: Double, y: Double, size: CGFloat) 30 | { 31 | super.init(x: x, y: y) 32 | 33 | self.size = size 34 | } 35 | 36 | /// - Parameters: 37 | /// - x: The index on the x-axis. 38 | /// - y: The value on the y-axis. 39 | /// - size: The size of the bubble. 40 | /// - data: Spot for additional data this Entry represents. 41 | @objc public convenience init(x: Double, y: Double, size: CGFloat, data: Any?) 42 | { 43 | self.init(x: x, y: y, size: size) 44 | self.data = data 45 | } 46 | 47 | /// - Parameters: 48 | /// - x: The index on the x-axis. 49 | /// - y: The value on the y-axis. 50 | /// - size: The size of the bubble. 51 | /// - icon: icon image 52 | @objc public convenience init(x: Double, y: Double, size: CGFloat, icon: NSUIImage?) 53 | { 54 | self.init(x: x, y: y, size: size) 55 | self.icon = icon 56 | } 57 | 58 | /// - Parameters: 59 | /// - x: The index on the x-axis. 60 | /// - y: The value on the y-axis. 61 | /// - size: The size of the bubble. 62 | /// - icon: icon image 63 | /// - data: Spot for additional data this Entry represents. 64 | @objc public convenience init(x: Double, y: Double, size: CGFloat, icon: NSUIImage?, data: Any?) 65 | { 66 | self.init(x: x, y: y, size: size) 67 | self.icon = icon 68 | self.data = data 69 | } 70 | 71 | // MARK: NSCopying 72 | 73 | open override func copy(with zone: NSZone? = nil) -> Any 74 | { 75 | let copy = super.copy(with: zone) as! BubbleChartDataEntry 76 | copy.size = size 77 | return copy 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Highlight/CombinedHighlighter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CombinedHighlighter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(CombinedChartHighlighter) 16 | open class CombinedHighlighter: ChartHighlighter 17 | { 18 | /// bar highlighter for supporting stacked highlighting 19 | private var barHighlighter: BarHighlighter? 20 | 21 | @objc public init(chart: CombinedChartDataProvider, barDataProvider: BarChartDataProvider) 22 | { 23 | super.init(chart: chart) 24 | 25 | // if there is BarData, create a BarHighlighter 26 | self.barHighlighter = barDataProvider.barData == nil ? nil : BarHighlighter(chart: barDataProvider) 27 | } 28 | 29 | open override func getHighlights(xValue: Double, x: CGFloat, y: CGFloat) -> [Highlight] 30 | { 31 | var vals = [Highlight]() 32 | 33 | guard 34 | let chart = self.chart as? CombinedChartDataProvider, 35 | let dataObjects = chart.combinedData?.allData 36 | else { return vals } 37 | 38 | for i in 0.. Bool { 87 | guard let object = object as? ChartDataEntryBase else { return false } 88 | 89 | if self === object 90 | { 91 | return true 92 | } 93 | 94 | return y == object.y 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineRadarChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | 16 | open class LineRadarChartDataSet: LineScatterCandleRadarChartDataSet, ILineRadarChartDataSet 17 | { 18 | // MARK: - Data functions and accessors 19 | 20 | // MARK: - Styling functions and accessors 21 | 22 | /// The color that is used for filling the line surface area. 23 | private var _fillColor = NSUIColor(red: 140.0/255.0, green: 234.0/255.0, blue: 255.0/255.0, alpha: 1.0) 24 | 25 | /// The color that is used for filling the line surface area. 26 | open var fillColor: NSUIColor 27 | { 28 | get { return _fillColor } 29 | set 30 | { 31 | _fillColor = newValue 32 | fill = nil 33 | } 34 | } 35 | 36 | /// The object that is used for filling the area below the line. 37 | /// **default**: nil 38 | open var fill: Fill? 39 | 40 | /// The alpha value that is used for filling the line surface, 41 | /// **default**: 0.33 42 | open var fillAlpha = CGFloat(0.33) 43 | 44 | private var _lineWidth = CGFloat(1.0) 45 | 46 | /// line width of the chart (min = 0.0, max = 10) 47 | /// 48 | /// **default**: 1 49 | open var lineWidth: CGFloat 50 | { 51 | get 52 | { 53 | return _lineWidth 54 | } 55 | set 56 | { 57 | _lineWidth = newValue.clamped(to: 0...10) 58 | } 59 | } 60 | 61 | /// Set to `true` if the DataSet should be drawn filled (surface), and not just as a line. 62 | /// Disabling this will give great performance boost. 63 | /// Please note that this method uses the path clipping for drawing the filled area (with images, gradients and layers). 64 | open var drawFilledEnabled = false 65 | 66 | /// `true` if filled drawing is enabled, `false` ifnot 67 | open var isDrawFilledEnabled: Bool 68 | { 69 | return drawFilledEnabled 70 | } 71 | 72 | // MARK: NSCopying 73 | 74 | open override func copy(with zone: NSZone? = nil) -> Any 75 | { 76 | let copy = super.copy(with: zone) as! LineRadarChartDataSet 77 | copy.fill = fill 78 | copy.fillAlpha = fillAlpha 79 | copy._fillColor = _fillColor 80 | copy._lineWidth = _lineWidth 81 | copy.drawFilledEnabled = drawFilledEnabled 82 | return copy 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Highlight/RadarHighlighter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RadarHighlighter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(RadarChartHighlighter) 16 | open class RadarHighlighter: PieRadarHighlighter 17 | { 18 | open override func closestHighlight(index: Int, x: CGFloat, y: CGFloat) -> Highlight? 19 | { 20 | guard let chart = self.chart as? RadarChartView else { return nil } 21 | 22 | let highlights = getHighlights(forIndex: index) 23 | 24 | let distanceToCenter = Double(chart.distanceToCenter(x: x, y: y) / chart.factor) 25 | 26 | var closest: Highlight? 27 | var distance = Double.greatestFiniteMagnitude 28 | 29 | for high in highlights 30 | { 31 | let cdistance = abs(high.y - distanceToCenter) 32 | if cdistance < distance 33 | { 34 | closest = high 35 | distance = cdistance 36 | } 37 | } 38 | 39 | return closest 40 | } 41 | 42 | /// - Parameters: 43 | /// - index: 44 | /// - Returns: An array of Highlight objects for the given index. 45 | /// The Highlight objects give information about the value at the selected index and DataSet it belongs to. 46 | internal func getHighlights(forIndex index: Int) -> [Highlight] 47 | { 48 | var vals = [Highlight]() 49 | 50 | guard 51 | let chart = self.chart as? RadarChartView, 52 | let chartData = chart.data 53 | else { return vals } 54 | 55 | let phaseX = chart.chartAnimator.phaseX 56 | let phaseY = chart.chartAnimator.phaseY 57 | let sliceangle = chart.sliceAngle 58 | let factor = chart.factor 59 | 60 | for i in chartData.dataSets.indices 61 | { 62 | guard 63 | let dataSet = chartData.getDataSetByIndex(i), 64 | let entry = dataSet.entryForIndex(index) 65 | else { continue } 66 | 67 | let y = (entry.y - chart.chartYMin) 68 | 69 | let p = chart.centerOffsets.moving(distance: CGFloat(y) * factor * CGFloat(phaseY), 70 | atAngle: sliceangle * CGFloat(index) * CGFloat(phaseX) + chart.rotationAngle) 71 | 72 | let highlight = Highlight(x: Double(index), y: entry.y, xPx: p.x, yPx: p.y, dataSetIndex: i, axis: dataSet.axisDependency) 73 | vals.append(highlight) 74 | } 75 | 76 | return vals 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Components/XAxis.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XAxis.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(ChartXAxis) 16 | open class XAxis: AxisBase 17 | { 18 | @objc(XAxisLabelPosition) 19 | public enum LabelPosition: Int 20 | { 21 | case top 22 | case bottom 23 | case bothSided 24 | case topInside 25 | case bottomInside 26 | } 27 | 28 | /// width of the x-axis labels in pixels - this is automatically calculated by the `computeSize()` methods in the renderers 29 | @objc open var labelWidth = CGFloat(1.0) 30 | 31 | /// height of the x-axis labels in pixels - this is automatically calculated by the `computeSize()` methods in the renderers 32 | @objc open var labelHeight = CGFloat(1.0) 33 | 34 | /// width of the (rotated) x-axis labels in pixels - this is automatically calculated by the `computeSize()` methods in the renderers 35 | @objc open var labelRotatedWidth = CGFloat(1.0) 36 | 37 | /// height of the (rotated) x-axis labels in pixels - this is automatically calculated by the `computeSize()` methods in the renderers 38 | @objc open var labelRotatedHeight = CGFloat(1.0) 39 | 40 | /// This is the angle for drawing the X axis labels (in degrees) 41 | @objc open var labelRotationAngle = CGFloat(0.0) 42 | 43 | /// if set to true, the chart will avoid that the first and last label entry in the chart "clip" off the edge of the chart 44 | @objc open var avoidFirstLastClippingEnabled = false 45 | 46 | /// the position of the x-labels relative to the chart 47 | @objc open var labelPosition = LabelPosition.top 48 | 49 | /// if set to true, word wrapping the labels will be enabled. 50 | /// word wrapping is done using `(value width * labelRotatedWidth)` 51 | /// 52 | /// - Note: currently supports all charts except pie/radar/horizontal-bar* 53 | @objc open var wordWrapEnabled = false 54 | 55 | /// `true` if word wrapping the labels is enabled 56 | @objc open var isWordWrapEnabled: Bool { return wordWrapEnabled } 57 | 58 | /// the width for wrapping the labels, as percentage out of one value width. 59 | /// used only when isWordWrapEnabled = true. 60 | /// 61 | /// **default**: 1.0 62 | @objc open var wordWrapWidthPercent: CGFloat = 1.0 63 | 64 | public override init() 65 | { 66 | super.init() 67 | 68 | self.yOffset = 4.0 69 | } 70 | 71 | @objc open var isAvoidFirstLastClippingEnabled: Bool 72 | { 73 | return avoidFirstLastClippingEnabled 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/ScatterChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScatterChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | open class ScatterChartDataSet: LineScatterCandleRadarChartDataSet, IScatterChartDataSet 16 | { 17 | 18 | @objc(ScatterShape) 19 | public enum Shape: Int 20 | { 21 | case square 22 | case circle 23 | case triangle 24 | case cross 25 | case x 26 | case chevronUp 27 | case chevronDown 28 | } 29 | 30 | /// The size the scatter shape will have 31 | open var scatterShapeSize = CGFloat(10.0) 32 | 33 | /// The radius of the hole in the shape (applies to Square, Circle and Triangle) 34 | /// **default**: 0.0 35 | open var scatterShapeHoleRadius: CGFloat = 0.0 36 | 37 | /// Color for the hole in the shape. Setting to `nil` will behave as transparent. 38 | /// **default**: nil 39 | open var scatterShapeHoleColor: NSUIColor? = nil 40 | 41 | /// Sets the ScatterShape this DataSet should be drawn with. 42 | /// This will search for an available IShapeRenderer and set this renderer for the DataSet 43 | @objc open func setScatterShape(_ shape: Shape) 44 | { 45 | self.shapeRenderer = ScatterChartDataSet.renderer(forShape: shape) 46 | } 47 | 48 | /// The IShapeRenderer responsible for rendering this DataSet. 49 | /// This can also be used to set a custom IShapeRenderer aside from the default ones. 50 | /// **default**: `SquareShapeRenderer` 51 | open var shapeRenderer: IShapeRenderer? = SquareShapeRenderer() 52 | 53 | @objc open class func renderer(forShape shape: Shape) -> IShapeRenderer 54 | { 55 | switch shape 56 | { 57 | case .square: return SquareShapeRenderer() 58 | case .circle: return CircleShapeRenderer() 59 | case .triangle: return TriangleShapeRenderer() 60 | case .cross: return CrossShapeRenderer() 61 | case .x: return XShapeRenderer() 62 | case .chevronUp: return ChevronUpShapeRenderer() 63 | case .chevronDown: return ChevronDownShapeRenderer() 64 | } 65 | } 66 | 67 | // MARK: NSCopying 68 | 69 | open override func copy(with zone: NSZone? = nil) -> Any 70 | { 71 | let copy = super.copy(with: zone) as! ScatterChartDataSet 72 | copy.scatterShapeSize = scatterShapeSize 73 | copy.scatterShapeHoleRadius = scatterShapeHoleRadius 74 | copy.scatterShapeHoleColor = scatterShapeHoleColor 75 | copy.shapeRenderer = shapeRenderer 76 | return copy 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/Scatter/TriangleShapeRenderer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TriangleShapeRenderer.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | import Foundation 12 | import CoreGraphics 13 | 14 | open class TriangleShapeRenderer : NSObject, IShapeRenderer 15 | { 16 | open func renderShape( 17 | context: CGContext, 18 | dataSet: IScatterChartDataSet, 19 | viewPortHandler: ViewPortHandler, 20 | point: CGPoint, 21 | color: NSUIColor) 22 | { 23 | let shapeSize = dataSet.scatterShapeSize 24 | let shapeHalf = shapeSize / 2.0 25 | let shapeHoleSizeHalf = dataSet.scatterShapeHoleRadius 26 | let shapeHoleSize = shapeHoleSizeHalf * 2.0 27 | let shapeHoleColor = dataSet.scatterShapeHoleColor 28 | let shapeStrokeSize = (shapeSize - shapeHoleSize) / 2.0 29 | 30 | context.setFillColor(color.cgColor) 31 | 32 | // create a triangle path 33 | context.beginPath() 34 | context.move(to: CGPoint(x: point.x, y: point.y - shapeHalf)) 35 | context.addLine(to: CGPoint(x: point.x + shapeHalf, y: point.y + shapeHalf)) 36 | context.addLine(to: CGPoint(x: point.x - shapeHalf, y: point.y + shapeHalf)) 37 | 38 | if shapeHoleSize > 0.0 39 | { 40 | context.addLine(to: CGPoint(x: point.x, y: point.y - shapeHalf)) 41 | 42 | context.move(to: CGPoint(x: point.x - shapeHalf + shapeStrokeSize, y: point.y + shapeHalf - shapeStrokeSize)) 43 | context.addLine(to: CGPoint(x: point.x + shapeHalf - shapeStrokeSize, y: point.y + shapeHalf - shapeStrokeSize)) 44 | context.addLine(to: CGPoint(x: point.x, y: point.y - shapeHalf + shapeStrokeSize)) 45 | context.addLine(to: CGPoint(x: point.x - shapeHalf + shapeStrokeSize, y: point.y + shapeHalf - shapeStrokeSize)) 46 | } 47 | 48 | context.closePath() 49 | 50 | context.fillPath() 51 | 52 | if shapeHoleSize > 0.0 && shapeHoleColor != nil 53 | { 54 | context.setFillColor(shapeHoleColor!.cgColor) 55 | 56 | // create a triangle path 57 | context.beginPath() 58 | context.move(to: CGPoint(x: point.x, y: point.y - shapeHalf + shapeStrokeSize)) 59 | context.addLine(to: CGPoint(x: point.x + shapeHalf - shapeStrokeSize, y: point.y + shapeHalf - shapeStrokeSize)) 60 | context.addLine(to: CGPoint(x: point.x - shapeHalf + shapeStrokeSize, y: point.y + shapeHalf - shapeStrokeSize)) 61 | context.closePath() 62 | 63 | context.fillPath() 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Formatters/DefaultAxisValueFormatter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultAxisValueFormatter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | @objc(ChartDefaultAxisValueFormatter) 15 | open class DefaultAxisValueFormatter: NSObject, IAxisValueFormatter 16 | { 17 | public typealias Block = ( 18 | _ value: Double, 19 | _ axis: AxisBase?) -> String 20 | 21 | @objc open var block: Block? 22 | 23 | @objc open var hasAutoDecimals: Bool = false 24 | 25 | private var _formatter: NumberFormatter? 26 | @objc open var formatter: NumberFormatter? 27 | { 28 | get { return _formatter } 29 | set 30 | { 31 | hasAutoDecimals = false 32 | _formatter = newValue 33 | } 34 | } 35 | 36 | // TODO: Documentation. Especially the nil case 37 | private var _decimals: Int? 38 | open var decimals: Int? 39 | { 40 | get { return _decimals } 41 | set 42 | { 43 | _decimals = newValue 44 | 45 | if let digits = newValue 46 | { 47 | self.formatter?.minimumFractionDigits = digits 48 | self.formatter?.maximumFractionDigits = digits 49 | self.formatter?.usesGroupingSeparator = true 50 | } 51 | } 52 | } 53 | 54 | public override init() 55 | { 56 | super.init() 57 | 58 | self.formatter = NumberFormatter() 59 | hasAutoDecimals = true 60 | } 61 | 62 | @objc public init(formatter: NumberFormatter) 63 | { 64 | super.init() 65 | 66 | self.formatter = formatter 67 | } 68 | 69 | @objc public init(decimals: Int) 70 | { 71 | super.init() 72 | 73 | self.formatter = NumberFormatter() 74 | self.formatter?.usesGroupingSeparator = true 75 | self.decimals = decimals 76 | hasAutoDecimals = true 77 | } 78 | 79 | @objc public init(block: @escaping Block) 80 | { 81 | super.init() 82 | 83 | self.block = block 84 | } 85 | 86 | @objc public static func with(block: @escaping Block) -> DefaultAxisValueFormatter? 87 | { 88 | return DefaultAxisValueFormatter(block: block) 89 | } 90 | 91 | open func stringForValue(_ value: Double, 92 | axis: AxisBase?) -> String 93 | { 94 | if let block = block { 95 | return block(value, axis) 96 | } else { 97 | return formatter?.string(from: NSNumber(floatLiteral: value)) ?? "" 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CandleChartDataEntry.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | open class CandleChartDataEntry: ChartDataEntry 15 | { 16 | /// shadow-high value 17 | @objc open var high = Double(0.0) 18 | 19 | /// shadow-low value 20 | @objc open var low = Double(0.0) 21 | 22 | /// close value 23 | @objc open var close = Double(0.0) 24 | 25 | /// open value 26 | @objc open var open = Double(0.0) 27 | 28 | public required init() 29 | { 30 | super.init() 31 | } 32 | 33 | @objc public init(x: Double, shadowH: Double, shadowL: Double, open: Double, close: Double) 34 | { 35 | super.init(x: x, y: (shadowH + shadowL) / 2.0) 36 | 37 | self.high = shadowH 38 | self.low = shadowL 39 | self.open = open 40 | self.close = close 41 | } 42 | 43 | @objc public convenience init(x: Double, shadowH: Double, shadowL: Double, open: Double, close: Double, icon: NSUIImage?) 44 | { 45 | self.init(x: x, shadowH: shadowH, shadowL: shadowL, open: open, close: close) 46 | self.icon = icon 47 | } 48 | 49 | @objc public convenience init(x: Double, shadowH: Double, shadowL: Double, open: Double, close: Double, data: Any?) 50 | { 51 | self.init(x: x, shadowH: shadowH, shadowL: shadowL, open: open, close: close) 52 | self.data = data 53 | } 54 | 55 | @objc public convenience init(x: Double, shadowH: Double, shadowL: Double, open: Double, close: Double, icon: NSUIImage?, data: Any?) 56 | { 57 | self.init(x: x, shadowH: shadowH, shadowL: shadowL, open: open, close: close) 58 | self.icon = icon 59 | self.data = data 60 | } 61 | 62 | /// The overall range (difference) between shadow-high and shadow-low. 63 | @objc open var shadowRange: Double 64 | { 65 | return abs(high - low) 66 | } 67 | 68 | /// The body size (difference between open and close). 69 | @objc open var bodyRange: Double 70 | { 71 | return abs(open - close) 72 | } 73 | 74 | /// the center value of the candle. (Middle value between high and low) 75 | open override var y: Double 76 | { 77 | get 78 | { 79 | return super.y 80 | } 81 | set 82 | { 83 | super.y = (high + low) / 2.0 84 | } 85 | } 86 | 87 | // MARK: NSCopying 88 | 89 | open override func copy(with zone: NSZone? = nil) -> Any 90 | { 91 | let copy = super.copy(with: zone) as! CandleChartDataEntry 92 | copy.high = high 93 | copy.low = low 94 | copy.open = open 95 | copy.close = close 96 | return copy 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Interfaces/ILineChartDataSet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ILineChartDataSet.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | 16 | @objc 17 | public protocol ILineChartDataSet: ILineRadarChartDataSet 18 | { 19 | // MARK: - Data functions and accessors 20 | 21 | // MARK: - Styling functions and accessors 22 | 23 | /// The drawing mode for this line dataset 24 | /// 25 | /// **default**: Linear 26 | var mode: LineChartDataSet.Mode { get set } 27 | 28 | /// Intensity for cubic lines (min = 0.05, max = 1) 29 | /// 30 | /// **default**: 0.2 31 | var cubicIntensity: CGFloat { get set } 32 | 33 | /// The radius of the drawn circles. 34 | var circleRadius: CGFloat { get set } 35 | 36 | /// The hole radius of the drawn circles. 37 | var circleHoleRadius: CGFloat { get set } 38 | 39 | var circleColors: [NSUIColor] { get set } 40 | 41 | /// - Returns: The color at the given index of the DataSet's circle-color array. 42 | /// Performs a IndexOutOfBounds check by modulus. 43 | func getCircleColor(atIndex: Int) -> NSUIColor? 44 | 45 | /// Sets the one and ONLY color that should be used for this DataSet. 46 | /// Internally, this recreates the colors array and adds the specified color. 47 | func setCircleColor(_ color: NSUIColor) 48 | 49 | /// Resets the circle-colors array and creates a new one 50 | func resetCircleColors(_ index: Int) 51 | 52 | /// If true, drawing circles is enabled 53 | var drawCirclesEnabled: Bool { get set } 54 | 55 | /// `true` if drawing circles for this DataSet is enabled, `false` ifnot 56 | var isDrawCirclesEnabled: Bool { get } 57 | 58 | /// The color of the inner circle (the circle-hole). 59 | var circleHoleColor: NSUIColor? { get set } 60 | 61 | /// `true` if drawing circles for this DataSet is enabled, `false` ifnot 62 | var drawCircleHoleEnabled: Bool { get set } 63 | 64 | /// `true` if drawing the circle-holes is enabled, `false` ifnot. 65 | var isDrawCircleHoleEnabled: Bool { get } 66 | 67 | /// This is how much (in pixels) into the dash pattern are we starting from. 68 | var lineDashPhase: CGFloat { get } 69 | 70 | /// This is the actual dash pattern. 71 | /// I.e. [2, 3] will paint [-- -- ] 72 | /// [1, 3, 4, 2] will paint [- ---- - ---- ] 73 | var lineDashLengths: [CGFloat]? { get set } 74 | 75 | /// Line cap type, default is CGLineCap.Butt 76 | var lineCapType: CGLineCap { get set } 77 | 78 | /// Sets a custom IFillFormatter to the chart that handles the position of the filled-line for each DataSet. Set this to null to use the default logic. 79 | var fillFormatter: IFillFormatter? { get set } 80 | } 81 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Components/MarkerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChartMarkerView.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | #if canImport(AppKit) 16 | import AppKit 17 | #endif 18 | 19 | @objc(ChartMarkerView) 20 | open class MarkerView: NSUIView, IMarker 21 | { 22 | open var offset: CGPoint = CGPoint() 23 | 24 | @objc open weak var chartView: ChartViewBase? 25 | 26 | open func offsetForDrawing(atPoint point: CGPoint) -> CGPoint 27 | { 28 | guard let chart = chartView else { return self.offset } 29 | 30 | var offset = self.offset 31 | 32 | let width = self.bounds.size.width 33 | let height = self.bounds.size.height 34 | 35 | if point.x + offset.x < 0.0 36 | { 37 | offset.x = -point.x 38 | } 39 | else if point.x + width + offset.x > chart.bounds.size.width 40 | { 41 | offset.x = chart.bounds.size.width - point.x - width 42 | } 43 | 44 | if point.y + offset.y < 0 45 | { 46 | offset.y = -point.y 47 | } 48 | else if point.y + height + offset.y > chart.bounds.size.height 49 | { 50 | offset.y = chart.bounds.size.height - point.y - height 51 | } 52 | 53 | return offset 54 | } 55 | 56 | open func refreshContent(entry: ChartDataEntry, highlight: Highlight) 57 | { 58 | // Do nothing here... 59 | } 60 | 61 | open func draw(context: CGContext, point: CGPoint) 62 | { 63 | let offset = self.offsetForDrawing(atPoint: point) 64 | 65 | context.saveGState() 66 | context.translateBy(x: point.x + offset.x, 67 | y: point.y + offset.y) 68 | NSUIGraphicsPushContext(context) 69 | self.nsuiLayer?.render(in: context) 70 | NSUIGraphicsPopContext() 71 | context.restoreGState() 72 | } 73 | 74 | @objc 75 | open class func viewFromXib(in bundle: Bundle = .main) -> MarkerView? 76 | { 77 | #if !os(OSX) 78 | 79 | return bundle.loadNibNamed( 80 | String(describing: self), 81 | owner: nil, 82 | options: nil)?[0] as? MarkerView 83 | #else 84 | 85 | var loadedObjects = NSArray() 86 | let loadedObjectsPointer = AutoreleasingUnsafeMutablePointer(&loadedObjects) 87 | 88 | if bundle.loadNibNamed( 89 | NSNib.Name(String(describing: self)), 90 | owner: nil, 91 | topLevelObjects: loadedObjectsPointer) 92 | { 93 | return loadedObjects[0] as? MarkerView 94 | } 95 | 96 | return nil 97 | #endif 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Formatters/DefaultValueFormatter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DefaultValueFormatter.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | @objc(ChartDefaultValueFormatter) 15 | open class DefaultValueFormatter: NSObject, IValueFormatter 16 | { 17 | public typealias Block = ( 18 | _ value: Double, 19 | _ entry: ChartDataEntry, 20 | _ dataSetIndex: Int, 21 | _ viewPortHandler: ViewPortHandler?) -> String 22 | 23 | @objc open var block: Block? 24 | 25 | @objc open var hasAutoDecimals: Bool = false 26 | 27 | private var _formatter: NumberFormatter? 28 | @objc open var formatter: NumberFormatter? 29 | { 30 | get { return _formatter } 31 | set 32 | { 33 | hasAutoDecimals = false 34 | _formatter = newValue 35 | } 36 | } 37 | 38 | private var _decimals: Int? 39 | open var decimals: Int? 40 | { 41 | get { return _decimals } 42 | set 43 | { 44 | _decimals = newValue 45 | 46 | if let digits = newValue 47 | { 48 | self.formatter?.minimumFractionDigits = digits 49 | self.formatter?.maximumFractionDigits = digits 50 | self.formatter?.usesGroupingSeparator = true 51 | } 52 | } 53 | } 54 | 55 | public override init() 56 | { 57 | super.init() 58 | 59 | self.formatter = NumberFormatter() 60 | hasAutoDecimals = true 61 | } 62 | 63 | @objc public init(formatter: NumberFormatter) 64 | { 65 | super.init() 66 | 67 | self.formatter = formatter 68 | } 69 | 70 | @objc public init(decimals: Int) 71 | { 72 | super.init() 73 | 74 | self.formatter = NumberFormatter() 75 | self.formatter?.usesGroupingSeparator = true 76 | self.decimals = decimals 77 | hasAutoDecimals = true 78 | } 79 | 80 | @objc public init(block: @escaping Block) 81 | { 82 | super.init() 83 | 84 | self.block = block 85 | } 86 | 87 | @objc public static func with(block: @escaping Block) -> DefaultValueFormatter? 88 | { 89 | return DefaultValueFormatter(block: block) 90 | } 91 | 92 | open func stringForValue(_ value: Double, 93 | entry: ChartDataEntry, 94 | dataSetIndex: Int, 95 | viewPortHandler: ViewPortHandler?) -> String 96 | { 97 | if let block = block { 98 | return block(value, entry, dataSetIndex, viewPortHandler) 99 | } else { 100 | return formatter?.string(from: NSNumber(floatLiteral: value)) ?? "" 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Components/MarkerImage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChartMarkerImage.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(ChartMarkerImage) 16 | open class MarkerImage: NSObject, IMarker 17 | { 18 | /// The marker image to render 19 | @objc open var image: NSUIImage? 20 | 21 | open var offset: CGPoint = CGPoint() 22 | 23 | @objc open weak var chartView: ChartViewBase? 24 | 25 | /// As long as size is 0.0/0.0 - it will default to the image's size 26 | @objc open var size: CGSize = CGSize() 27 | 28 | public override init() 29 | { 30 | super.init() 31 | } 32 | 33 | open func offsetForDrawing(atPoint point: CGPoint) -> CGPoint 34 | { 35 | var offset = self.offset 36 | 37 | let chart = self.chartView 38 | 39 | var size = self.size 40 | 41 | if size.width == 0.0 && image != nil 42 | { 43 | size.width = image?.size.width ?? 0.0 44 | } 45 | if size.height == 0.0 && image != nil 46 | { 47 | size.height = image?.size.height ?? 0.0 48 | } 49 | 50 | let width = size.width 51 | let height = size.height 52 | 53 | if point.x + offset.x < 0.0 54 | { 55 | offset.x = -point.x 56 | } 57 | else if chart != nil && point.x + width + offset.x > chart!.bounds.size.width 58 | { 59 | offset.x = chart!.bounds.size.width - point.x - width 60 | } 61 | 62 | if point.y + offset.y < 0 63 | { 64 | offset.y = -point.y 65 | } 66 | else if chart != nil && point.y + height + offset.y > chart!.bounds.size.height 67 | { 68 | offset.y = chart!.bounds.size.height - point.y - height 69 | } 70 | 71 | return offset 72 | } 73 | 74 | open func refreshContent(entry: ChartDataEntry, highlight: Highlight) 75 | { 76 | // Do nothing here... 77 | } 78 | 79 | open func draw(context: CGContext, point: CGPoint) 80 | { 81 | guard let image = image else { return } 82 | 83 | let offset = offsetForDrawing(atPoint: point) 84 | 85 | var size = self.size 86 | 87 | if size.width == 0.0 88 | { 89 | size.width = image.size.width 90 | } 91 | if size.height == 0.0 92 | { 93 | size.height = image.size.height 94 | } 95 | 96 | let rect = CGRect( 97 | x: point.x + offset.x, 98 | y: point.y + offset.y, 99 | width: size.width, 100 | height: size.height) 101 | 102 | NSUIGraphicsPushContext(context) 103 | image.draw(in: rect) 104 | NSUIGraphicsPopContext() 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ChartDataEntry.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | open class ChartDataEntry: ChartDataEntryBase, NSCopying 15 | { 16 | /// the x value 17 | @objc open var x = 0.0 18 | 19 | public required init() 20 | { 21 | super.init() 22 | } 23 | 24 | /// An Entry represents one single entry in the chart. 25 | /// 26 | /// - Parameters: 27 | /// - x: the x value 28 | /// - y: the y value (the actual value of the entry) 29 | @objc public init(x: Double, y: Double) 30 | { 31 | super.init(y: y) 32 | self.x = x 33 | } 34 | 35 | /// An Entry represents one single entry in the chart. 36 | /// 37 | /// - Parameters: 38 | /// - x: the x value 39 | /// - y: the y value (the actual value of the entry) 40 | /// - data: Space for additional data this Entry represents. 41 | 42 | @objc public convenience init(x: Double, y: Double, data: Any?) 43 | { 44 | self.init(x: x, y: y) 45 | self.data = data 46 | } 47 | 48 | /// An Entry represents one single entry in the chart. 49 | /// 50 | /// - Parameters: 51 | /// - x: the x value 52 | /// - y: the y value (the actual value of the entry) 53 | /// - icon: icon image 54 | 55 | @objc public convenience init(x: Double, y: Double, icon: NSUIImage?) 56 | { 57 | self.init(x: x, y: y) 58 | self.icon = icon 59 | } 60 | 61 | /// An Entry represents one single entry in the chart. 62 | /// 63 | /// - Parameters: 64 | /// - x: the x value 65 | /// - y: the y value (the actual value of the entry) 66 | /// - icon: icon image 67 | /// - data: Space for additional data this Entry represents. 68 | 69 | @objc public convenience init(x: Double, y: Double, icon: NSUIImage?, data: Any?) 70 | { 71 | self.init(x: x, y: y) 72 | self.icon = icon 73 | self.data = data 74 | } 75 | 76 | // MARK: NSObject 77 | 78 | open override var description: String 79 | { 80 | return "ChartDataEntry, x: \(x), y \(y)" 81 | } 82 | 83 | // MARK: NSCopying 84 | 85 | open func copy(with zone: NSZone? = nil) -> Any 86 | { 87 | let copy = type(of: self).init() 88 | 89 | copy.x = x 90 | copy.y = y 91 | copy.data = data 92 | 93 | return copy 94 | } 95 | } 96 | 97 | // MARK: Equatable 98 | extension ChartDataEntry/*: Equatable*/ { 99 | open override func isEqual(_ object: Any?) -> Bool { 100 | guard let object = object as? ChartDataEntry else { return false } 101 | 102 | if self === object 103 | { 104 | return true 105 | } 106 | 107 | return y == object.y 108 | && x == object.x 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Renderers/XAxisRendererRadarChart.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XAxisRendererRadarChart.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | open class XAxisRendererRadarChart: XAxisRenderer 16 | { 17 | @objc open weak var chart: RadarChartView? 18 | 19 | @objc public init(viewPortHandler: ViewPortHandler, xAxis: XAxis?, chart: RadarChartView) 20 | { 21 | super.init(viewPortHandler: viewPortHandler, xAxis: xAxis, transformer: nil) 22 | 23 | self.chart = chart 24 | } 25 | 26 | open override func renderAxisLabels(context: CGContext) 27 | { 28 | guard let 29 | xAxis = axis as? XAxis, 30 | let chart = chart 31 | else { return } 32 | 33 | if !xAxis.isEnabled || !xAxis.isDrawLabelsEnabled 34 | { 35 | return 36 | } 37 | 38 | let labelFont = xAxis.labelFont 39 | let labelTextColor = xAxis.labelTextColor 40 | let labelRotationAngleRadians = xAxis.labelRotationAngle.RAD2DEG 41 | let drawLabelAnchor = CGPoint(x: 0.5, y: 0.25) 42 | 43 | let sliceangle = chart.sliceAngle 44 | 45 | // calculate the factor that is needed for transforming the value to pixels 46 | let factor = chart.factor 47 | 48 | let center = chart.centerOffsets 49 | 50 | for i in stride(from: 0, to: chart.data?.maxEntryCountSet?.entryCount ?? 0, by: 1) 51 | { 52 | 53 | let label = xAxis.valueFormatter?.stringForValue(Double(i), axis: xAxis) ?? "" 54 | 55 | let angle = (sliceangle * CGFloat(i) + chart.rotationAngle).truncatingRemainder(dividingBy: 360.0) 56 | 57 | let p = center.moving(distance: CGFloat(chart.yRange) * factor + xAxis.labelRotatedWidth / 2.0, atAngle: angle) 58 | 59 | drawLabel(context: context, 60 | formattedLabel: label, 61 | x: p.x, 62 | y: p.y - xAxis.labelRotatedHeight / 2.0, 63 | attributes: [NSAttributedString.Key.font: labelFont, NSAttributedString.Key.foregroundColor: labelTextColor], 64 | anchor: drawLabelAnchor, 65 | angleRadians: labelRotationAngleRadians) 66 | } 67 | } 68 | 69 | @objc open func drawLabel( 70 | context: CGContext, 71 | formattedLabel: String, 72 | x: CGFloat, 73 | y: CGFloat, 74 | attributes: [NSAttributedString.Key : Any], 75 | anchor: CGPoint, 76 | angleRadians: CGFloat) 77 | { 78 | ChartUtils.drawText( 79 | context: context, 80 | text: formattedLabel, 81 | point: CGPoint(x: x, y: y), 82 | attributes: attributes, 83 | anchor: anchor, 84 | angleRadians: angleRadians) 85 | } 86 | 87 | open override func renderLimitLines(context: CGContext) 88 | { 89 | /// XAxis LimitLines on RadarChart not yet supported. 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Components/LegendEntry.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LegendEntry.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | import CoreGraphics 14 | 15 | @objc(ChartLegendEntry) 16 | open class LegendEntry: NSObject 17 | { 18 | public override init() 19 | { 20 | super.init() 21 | } 22 | 23 | /// - Parameters: 24 | /// - label: The legend entry text. 25 | /// A `nil` label will start a group. 26 | /// - form: The form to draw for this entry. 27 | /// - formSize: Set to NaN to use the legend's default. 28 | /// - formLineWidth: Set to NaN to use the legend's default. 29 | /// - formLineDashPhase: Line dash configuration. 30 | /// - formLineDashLengths: Line dash configurationas NaN to use the legend's default. 31 | /// - formColor: The color for drawing the form. 32 | @objc public init(label: String?, 33 | form: Legend.Form, 34 | formSize: CGFloat, 35 | formLineWidth: CGFloat, 36 | formLineDashPhase: CGFloat, 37 | formLineDashLengths: [CGFloat]?, 38 | formColor: NSUIColor?) 39 | { 40 | self.label = label 41 | self.form = form 42 | self.formSize = formSize 43 | self.formLineWidth = formLineWidth 44 | self.formLineDashPhase = formLineDashPhase 45 | self.formLineDashLengths = formLineDashLengths 46 | self.formColor = formColor 47 | } 48 | 49 | /// The legend entry text. 50 | /// A `nil` label will start a group. 51 | @objc open var label: String? 52 | 53 | /// The form to draw for this entry. 54 | /// 55 | /// `None` will avoid drawing a form, and any related space. 56 | /// `Empty` will avoid drawing a form, but keep its space. 57 | /// `Default` will use the Legend's default. 58 | @objc open var form: Legend.Form = .default 59 | 60 | /// Form size will be considered except for when .None is used 61 | /// 62 | /// Set as NaN to use the legend's default 63 | @objc open var formSize: CGFloat = CGFloat.nan 64 | 65 | /// Line width used for shapes that consist of lines. 66 | /// 67 | /// Set to NaN to use the legend's default. 68 | @objc open var formLineWidth: CGFloat = CGFloat.nan 69 | 70 | /// Line dash configuration for shapes that consist of lines. 71 | /// 72 | /// This is how much (in pixels) into the dash pattern are we starting from. 73 | /// 74 | /// Set to NaN to use the legend's default. 75 | @objc open var formLineDashPhase: CGFloat = 0.0 76 | 77 | /// Line dash configuration for shapes that consist of lines. 78 | /// 79 | /// This is the actual dash pattern. 80 | /// I.e. [2, 3] will paint [-- -- ] 81 | /// [1, 3, 4, 2] will paint [- ---- - ---- ] 82 | /// 83 | /// Set to nil to use the legend's default. 84 | @objc open var formLineDashLengths: [CGFloat]? 85 | 86 | /// The color for drawing the form 87 | @objc open var formColor: NSUIColor? 88 | } 89 | -------------------------------------------------------------------------------- /Pods/Charts/Source/Charts/Data/Implementations/Standard/PieChartData 2.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PieData.swift 3 | // Charts 4 | // 5 | // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda 6 | // A port of MPAndroidChart for iOS 7 | // Licensed under Apache License 2.0 8 | // 9 | // https://github.com/danielgindi/Charts 10 | // 11 | 12 | import Foundation 13 | 14 | open class PieChartData: ChartData 15 | { 16 | public override init() 17 | { 18 | super.init() 19 | } 20 | 21 | public override init(dataSets: [IChartDataSet]?) 22 | { 23 | super.init(dataSets: dataSets) 24 | } 25 | 26 | @objc var dataSet: IPieChartDataSet? 27 | { 28 | get 29 | { 30 | return dataSets.count > 0 ? dataSets[0] as? IPieChartDataSet : nil 31 | } 32 | set 33 | { 34 | if newValue != nil 35 | { 36 | dataSets = [newValue!] 37 | } 38 | else 39 | { 40 | dataSets = [] 41 | } 42 | } 43 | } 44 | 45 | open override func getDataSetByIndex(_ index: Int) -> IChartDataSet? 46 | { 47 | if index != 0 48 | { 49 | return nil 50 | } 51 | return super.getDataSetByIndex(index) 52 | } 53 | 54 | open override func getDataSetByLabel(_ label: String, ignorecase: Bool) -> IChartDataSet? 55 | { 56 | if dataSets.count == 0 || dataSets[0].label == nil 57 | { 58 | return nil 59 | } 60 | 61 | if ignorecase 62 | { 63 | if (label.caseInsensitiveCompare(dataSets[0].label!) == ComparisonResult.orderedSame) 64 | { 65 | return dataSets[0] 66 | } 67 | } 68 | else 69 | { 70 | if label == dataSets[0].label 71 | { 72 | return dataSets[0] 73 | } 74 | } 75 | return nil 76 | } 77 | 78 | open override func entryForHighlight(_ highlight: Highlight) -> ChartDataEntry? 79 | { 80 | return dataSet?.entryForIndex(Int(highlight.x)) 81 | } 82 | 83 | open override func addDataSet(_ d: IChartDataSet!) 84 | { 85 | super.addDataSet(d) 86 | } 87 | 88 | /// Removes the DataSet at the given index in the DataSet array from the data object. 89 | /// Also recalculates all minimum and maximum values. 90 | /// 91 | /// - returns: `true` if a DataSet was removed, `false` ifno DataSet could be removed. 92 | open override func removeDataSetByIndex(_ index: Int) -> Bool 93 | { 94 | if index >= _dataSets.count || index < 0 95 | { 96 | return false 97 | } 98 | 99 | return false 100 | } 101 | 102 | /// - returns: The total y-value sum across all DataSet objects the this object represents. 103 | @objc open var yValueSum: Double 104 | { 105 | guard let dataSet = dataSet else { return 0.0 } 106 | 107 | var yValueSum: Double = 0.0 108 | 109 | for i in 0..