Skip to content

Commit d2bf08f

Browse files
liuxuan30jjatiectranlarryonoffJacob Christie
authored
Resolve conflict for 4.0 branch and master (ChartsOrg#4456)
* Remove java interface convention (ChartsOrg#2997) * Renamed `IMarker` to `Marker` following Swift API guidelines. * Renamed `IAxisValueFormatter` to `AxisValueFormatter` * Renamed `IFillFormatter` to `FillFormatter` * Renamed `IValueFormatter` to `ValueFormatter` * Renamed `IHighlighter` to `Highlighter` * Renamed `I*DataSet` to `*DataSetProtocol` to follow Swift API guidelines * Fixed naming of `LineRadarChartDataSetProtocol` and `RadarChartDataSetProtocol` from previous commit * Renamed "Interfaces" to "DataProviders" for clarity * Updated Demos to for new type naming * Renderer protocols (ChartsOrg#3136) * Renderer is now a protocol Renamed Renderers, and organized the Renderer folder. * DataRenderer is now a protocol * AxisRenderer is now a protocol * Chartviewbase redundant ivar (ChartsOrg#3045) * Fixed using wrong axis (Issue ChartsOrg#2257) * fix ChartsOrg#1830. credit from ChartsOrg#2049 (ChartsOrg#2874) * fix ChartsOrg#1830. credit from ChartsOrg#2049 * add combined chart unit tests for iOS, tvOS (macOS only have build process) * use iterater rather than index * Removed redundant ivars in BarLineChartViewBase (ChartsOrg#3043) * Removed redundant ivars in favour of proper access control * Moved initialization of axes to their declaration to keep the same optionality exposed. * Update 4.0.0 with master (ChartsOrg#3135) * Replaced relevant `ChartUtils` methods with `Double` extensions (ChartsOrg#2994) * Replaced relevant `ChartUtils` methods with `Double` extensions Improves readability. `nextUp` is built in and provides the same functionality. * Updated `ChartUtilsTests` to match changes * add option to build demo projects unit tests on iOS (ChartsOrg#3121) * add option to build demo projects unit tests on iOS * add ChartsDemo-OSX build test. * Update ViewPortHandler.swift (ChartsOrg#3143) fix a small bug * Refactored ChartUtils method into CGPoint extension (ChartsOrg#3087) * Refactored ChartUtils method into CGPoint extension * Replaced ChartUtils.defaultValueFormatter() * Codestyle fixes * ChartViewBase cleanup For the most part, condensing logic and using `guard` where appropriate Removed optionality of many internal variables as they were only optional to allow for deferred initialization. This is now replaced with lazy vars. Removed empty initializer overrides. `fileprivate` is now `private` * Removed redundant ivars In favour of proper access control * Fixes after merge * Renamed `animator` to `chartAnimator` on `ChartViewBase` to no conflict with `NSView`'s `animator()` method. * pulled latest master * Code style fix * Removed AxisRendererBase.swift * Fixed demos * BarChartRenderer Logic cleanup (ChartsOrg#3008) * Logic cleanup Mostly using guard where appropriate Few very minor performance improvements * Made use of `==` where appropriate to simplify logic * Returned fatalError message * Replaced `Buffer` class with simple typealias. There was only one instance where reference semantics might have be helpful, but was easily reimplemented with value semantics. * Syncing 4.0.0 with master (ChartsOrg#3160) * Fixed using wrong axis (Issue ChartsOrg#2257) * fix ChartsOrg#1830. credit from ChartsOrg#2049 (ChartsOrg#2874) * fix ChartsOrg#1830. credit from ChartsOrg#2049 * add combined chart unit tests for iOS, tvOS (macOS only have build process) * use iterater rather than index * Removed redundant ivars in BarLineChartViewBase (ChartsOrg#3043) * Removed redundant ivars in favour of proper access control * Moved initialization of axes to their declaration to keep the same optionality exposed. * Update 4.0.0 with master (ChartsOrg#3135) * Replaced relevant `ChartUtils` methods with `Double` extensions (ChartsOrg#2994) * Replaced relevant `ChartUtils` methods with `Double` extensions Improves readability. `nextUp` is built in and provides the same functionality. * Updated `ChartUtilsTests` to match changes * add option to build demo projects unit tests on iOS (ChartsOrg#3121) * add option to build demo projects unit tests on iOS * add ChartsDemo-OSX build test. * Update ViewPortHandler.swift (ChartsOrg#3143) fix a small bug * Refactored ChartUtils method into CGPoint extension (ChartsOrg#3087) * Refactored ChartUtils method into CGPoint extension * Replaced ChartUtils.defaultValueFormatter() * Codestyle fixes * Minor cleanup to Highlighter types (ChartsOrg#3003) * Minor cleanup to Highlighter types * Fixes for PR * Pulled master and updated code style * added DataApproximator+N extension (ChartsOrg#2848) * added DataApproximator+N extension * fixed PR notes * Readded in missing files * Moved ChartUtils drawing methods into CGContext extension (ChartsOrg#3086) * Fixed using wrong axis (Issue ChartsOrg#2257) * fix ChartsOrg#1830. credit from ChartsOrg#2049 (ChartsOrg#2874) * fix ChartsOrg#1830. credit from ChartsOrg#2049 * add combined chart unit tests for iOS, tvOS (macOS only have build process) * use iterater rather than index * Removed redundant ivars in BarLineChartViewBase (ChartsOrg#3043) * Removed redundant ivars in favour of proper access control * Moved initialization of axes to their declaration to keep the same optionality exposed. * Update 4.0.0 with master (ChartsOrg#3135) * Replaced relevant `ChartUtils` methods with `Double` extensions (ChartsOrg#2994) * Replaced relevant `ChartUtils` methods with `Double` extensions Improves readability. `nextUp` is built in and provides the same functionality. * Updated `ChartUtilsTests` to match changes * add option to build demo projects unit tests on iOS (ChartsOrg#3121) * add option to build demo projects unit tests on iOS * add ChartsDemo-OSX build test. * Update ViewPortHandler.swift (ChartsOrg#3143) fix a small bug * Refactored ChartUtils method into CGPoint extension (ChartsOrg#3087) * Refactored ChartUtils method into CGPoint extension * Replaced ChartUtils.defaultValueFormatter() * Codestyle fixes * Minor cleanup to Highlighter types (ChartsOrg#3003) * Minor cleanup to Highlighter types * Fixes for PR * Pulled master and updated code style * added DataApproximator+N extension (ChartsOrg#2848) * added DataApproximator+N extension * fixed PR notes * Moved drawing methods into CGContext extension Much nicer call sites. Renamed some parameter names. Removed `NSAttributedStringKey` where type inference was sufficient. Minor tidy of drawText calls in AxisRenderers * Pulled latest master * Pulled master * Fixed code style * Utils Cleanup (ChartsOrg#3054) * Cleanup Replaced unnecessary getters with proper access control Replaced unnecessary convenience inits with default parameters Minor refactoring * Pulled latest master * Pulled latest master * Pulled latest master * Fix after pulling master * Fixed using wrong axis (Issue ChartsOrg#2257) * fix ChartsOrg#1830. credit from ChartsOrg#2049 (ChartsOrg#2874) * fix ChartsOrg#1830. credit from ChartsOrg#2049 * add combined chart unit tests for iOS, tvOS (macOS only have build process) * use iterater rather than index * Removed redundant ivars in BarLineChartViewBase (ChartsOrg#3043) * Removed redundant ivars in favour of proper access control * Moved initialization of axes to their declaration to keep the same optionality exposed. * Update 4.0.0 with master (ChartsOrg#3135) * Replaced relevant `ChartUtils` methods with `Double` extensions (ChartsOrg#2994) * Replaced relevant `ChartUtils` methods with `Double` extensions Improves readability. `nextUp` is built in and provides the same functionality. * Updated `ChartUtilsTests` to match changes * add option to build demo projects unit tests on iOS (ChartsOrg#3121) * add option to build demo projects unit tests on iOS * add ChartsDemo-OSX build test. * Update ViewPortHandler.swift (ChartsOrg#3143) fix a small bug * Refactored ChartUtils method into CGPoint extension (ChartsOrg#3087) * Refactored ChartUtils method into CGPoint extension * Replaced ChartUtils.defaultValueFormatter() * Codestyle fixes * Finished cleanup * Pulled master * Chartdata collection conformance (ChartsOrg#3023) * Added Collection conformances MutableCollection RandomAccessCollection RangeReplaceableCollection * Fixed required initializers * ChartData adopts ExressibleByArrayLiteral * Updates for PR Also added remove subrange. * PR review fixes * Removed unnecessary `get` from subscripts. * Disabled `remove(at:)` for CombinedChartView * Relocated `appendEntry(_:todataSet:)` * Removed methods from CombinedChartData * weak -> unowned (ChartsOrg#3039) * weak -> unowned `ViewPortJob`s are owned by the Charts that make them. They are guaranteed to only exist while the chart exists. The `Transformer` and `ViewPortHandler` are supplied by the chart, so they will also only exist while the chart exists. Therefor none of them need to be `weak`, but can be `unowned` instead. It's a minor change in the code base (removing some guard statements), but it makes it much easier to discern how the framework is architected. * pulled latest master * Removed optionality from valueFormatter where appropriate (ChartsOrg#3106) * Removed optionality from valueFormatter where appropriate In ChartBaseDataSet, `valueFormatter` never returned nil, and escaped early if trying to set it to nil. It appears this was made optional solely to provide lazy initialization. We now use a lazy var instead. In AxisBase, the backing var `_axisValueFormatter` would never be treated as nil, and appears to be made optional solely to provide lazy initialization. We now use a lazy var instead. In `valueFormatter` we can remove the `nil` check, but leave it optional to keep the same functionality. * Pulled 4.0.0 * Pulled latest 4.0.0 * Fixed pro file * Chartdata collection refactor (ChartsOrg#3024) * Added Collection conformances MutableCollection RandomAccessCollection RangeReplaceableCollection * [ChartsOrg#3018] Refactored use of `ChartData` to use new `Collection` conformances * Fixed required initializers * ChartData adopts ExressibleByArrayLiteral * Modified demos to take advantage of collection conformance. * Removed unnecessary `get` from subscripts. * Removed redundant methods * Relocated `appendEntry(_:todataSet:)` * Removed methods from CombinedChartData * Moved the default value formatter (ChartsOrg#3088) * Moved the default value formatter It is now simply `DefaultValueFomatter()` Removed unnecessary backing ivars in `DefaultValuetFormatter` in favour of property observers Deprecated static func constructor in favour of initializer * Add option to rotate value text for line charts * Add value text rotation for bar charts * Add value text rotation for other charts * Fixed misuse/deprecation of "!" operator * Updated projects for Xcode 9.3 and Swift 4.1 added a workspace to include all demos with the project to make it easier to test changes * Pulled master * Moved travis to Xcode 9.3beta temporarily * Updated Rakefile for new project names * Updated demo imports * Rename valueRotationAngle -> valueLabelAngle * Make function private & remove line break * Refactored ChartData (ChartsOrg#3169) * Added Collection conformances MutableCollection RandomAccessCollection RangeReplaceableCollection * [ChartsOrg#3018] Refactored use of `ChartData` to use new `Collection` conformances * Fixed required initializers * ChartData adopts ExressibleByArrayLiteral * Modified demos to take advantage of collection conformance. * Updates for PR Also added remove subrange. * Refactored ChartData Removed redundancy from min/max logic. Lots of naming changes. Cleaner implementations. * PR review fixes * Removed unnecessary `get` from subscripts. * Disabled `remove(at:)` for CombinedChartView * Removed redundant methods * Relocated `appendEntry(_:todataSet:)` * pulled latest 4.0.0 * Disabled Collection support for CombinedChartData * Removed methods from CombinedChartData * Pulled latest 4.0 * Fixes after merge * Removed used of dataSet(forIndex:) * Fixed merge conflicts * Fixed merge conflicts * updated demos * Pulled latest 4.0.0 * Fixed demos * Fixed objective c demos * Moved travis to Xcode 9.3 beta temporarily * Fixed macOS demo info.plist and tv demo device name * PR Fixes * Fixed objective-c naming * PR Fixes * fix comment * Remove unnecessary file (ChartsOrg#3432) * Dataset logic cleanup (ChartsOrg#3001) * Cleaned up `ChartDataSet` logic Added TODOs for areas where simple changes can help improve Swift consistency. * Tidied up logic for `ChartDataSet` subclasses Minor changes to take advantage of Swift features and help improve readability. * Added Collection conformances MutableCollection RandomAccessCollection RangeReplaceableCollection * [ChartsOrg#3018] Refactored use of `ChartData` to use new `Collection` conformances * Fixed required initializers * ChartData adopts ExressibleByArrayLiteral * Modified demos to take advantage of collection conformance. * Pulled latest master * Pulled latest master * Updates for PR Also added remove subrange. * Refactored ChartData Removed redundancy from min/max logic. Lots of naming changes. Cleaner implementations. * PR review fixes * Removed unnecessary `get` from subscripts. * Disabled `remove(at:)` for CombinedChartView * Removed redundant methods * Relocated `appendEntry(_:todataSet:)` * pulled latest 4.0.0 * Disabled Collection support for CombinedChartData * Removed methods from CombinedChartData * Pulled latest 4.0 * Fixes after merge * Removed used of dataSet(forIndex:) * Fixed merge conflicts * Fixed merge conflicts * updated demos * Pulled latest 4.0.0 * Fixed demos * Fixed objective c demos * Moved travis to Xcode 9.3 beta temporarily * Fixed macOS demo info.plist and tv demo device name * PR Fixes * Fixed objective-c naming * PR Fixes * PR Fixes * Added gradient line drawing to LineChartRenderer * Stabilize and clean the code * Extract line drawing into function * Fix macOS build * Move `drawGradientLine` out of `drawLine` method * Remove unused parameters from `drawLine` function * Fix gradient location calculation * Add toggle gradient line into demo options * Improvements after code review * Code cleanup * Remove unnecessary function for generating gradient line - additional code optimizations * Fix: gradient lines peaks are truncated when line width > 1 * Make legendRenderer property public in order to be externally customizable * fix build issue in objc demo * Add minimum slice angle for value labels to PieChartView * Rename drawSliceTextMinimumAngle to sliceTextDrawingThreshold * Fix sliceTextDrawingThreshold renaming in demo * fix build of demos * Add label colors to legend entries (ChartsOrg#3558) * add label colors to legend entries * Change interface of LegendEntry * Add Swift version 4.1 to podspec * Turned gradient components and locations into constants (ChartsOrg#3775) * Cleaned up `ChartDataSet` logic Added TODOs for areas where simple changes can help improve Swift consistency. * Added Collection conformances MutableCollection RandomAccessCollection RangeReplaceableCollection * [ChartsOrg#3018] Refactored use of `ChartData` to use new `Collection` conformances * Fixed required initializers * ChartData adopts ExressibleByArrayLiteral * Modified demos to take advantage of collection conformance. * Pulled latest master * Unified Style Replaced custom algorithms with built-in ones Made axis renderer implementations feel "Swift-ier" * Updates for PR Also added remove subrange. * Refactored ChartData Removed redundancy from min/max logic. Lots of naming changes. Cleaner implementations. * Fixed horizontal barchart bug, * Removed unnecessary `get` from subscripts. * Disabled `remove(at:)` for CombinedChartView * Relocated `appendEntry(_:todataSet:)` * Disabled Collection support for CombinedChartData * Removed used of dataSet(forIndex:) * Fixed merge conflicts * updated demos * PR Fixes * Fixed axisLabels calculation * Fill rewrite (ChartsOrg#3084) close ChartsOrg#3140 * Fill is now a protocol Different fill logic is broken up into separate classes. This has a few benefits: 1. It makes the `Fill` types more readable (logic is grouped together) 2. No optionals 3. Most importantly it allows consumers to create new Fill types without looking into the framework. * Added super.init() for objc * Updated Fill access No need to subclass existing fills now that the system is more flexible. If functionality is needed from another fill, user can call it within their own `fillPath(context: CGContext, rect: CGRect)` implementation. * Updated Fill Names * Update Fill.swift update code style Co-authored-by: Jacob Christie <[email protected]> Co-authored-by: Xuan <[email protected]> * update to Swift 5, Xcode 13.5.1, and fix warnings * fix all compile errors and wrong symbols either by git or me. * revert back to convenience init for BarChartDataSet fix ChartDataTests compile errors: use new API dataSet(forLabel:, ignorecase: ) * actually, I compared the old master and find this is a mistake while merging to make init(label:) in BarChartDataSet. It should be in ChartDataSet. * fix -0.0 issue in 4.0 merge. fix func calculateLegendOffsets in BarLineChartViewBase due to mistaking added back offsetBottom += xAxis.labelRotatedHeight. see ChartsOrg#4277 for details now bar & horizontal bar chart tests should pass. * fix pie chart UT failures. didSet will no be called in init(), so we call it manually also fix set.valueFormatter in data setter * fix line chart UT failures * Remove `isIndirectValuesCall` * Bump Travis to Xcode 12 * Remove misuse of `count` (ChartsOrg#4461) * Remove misuse of `count` * Fix protocol method name * Update ChartColorTemplates.swift use fallbackColor for `colorFromString()` * Revert "Update ChartColorTemplates.swift" This reverts commit b4111fd. Co-authored-by: Xuan <[email protected]> * switch to source compiling swift code * fix Carthage error after changing to source compile. Carthage/Carthage#3019 there is a workaround mentioned [here](Carthage/Carthage#3019 (comment)) making travis to build from carthage.sh until the root issue is fixed. * update project settings * recreate iOS+tvOS images due to iOS14 SDK uncertain changes. * Remove unnecessary ternary in boolean expression (ChartsOrg#4435) * Remove internal use of datasets (ChartsOrg#4459) * Remove internal use of ChartData.dataSets * Rebased onto ResolveConflicts * Remove duplicated line Co-authored-by: jjatie <[email protected]> Co-authored-by: ctran <[email protected]> Co-authored-by: larryonoff <[email protected]> Co-authored-by: Jacob Christie <[email protected]> Co-authored-by: Katalin Nagy <[email protected]> Co-authored-by: Pierre-Marc Airoldi <[email protected]> Co-authored-by: Marshall Weir <[email protected]> Co-authored-by: Jacob Christie <[email protected]> Co-authored-by: Jacob Christie <[email protected]> Co-authored-by: Jacob Christie <[email protected]> Co-authored-by: BJ Miller <[email protected]>
1 parent ae78bad commit d2bf08f

File tree

278 files changed

+4166
-4688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+4166
-4688
lines changed

.travis.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
language: objective-c
2-
osx_image: xcode11
2+
osx_image: xcode12
33
matrix:
44
include:
5-
- osx_image: xcode11
5+
- osx_image: xcode12
66
env: PLATFORM="iOS"
7-
- osx_image: xcode11
7+
- osx_image: xcode12
88
env: PLATFORM="tvOS"
9-
- osx_image: xcode11
9+
- osx_image: xcode12
1010
env: PLATFORM="macOS"
1111
env:
1212
global:
@@ -18,7 +18,7 @@ before_install:
1818
- brew update
1919
- brew upgrade carthage || true
2020
- carthage version
21-
- carthage bootstrap --platform $PLATFORM
21+
- ./carthage.sh bootstrap --platform $PLATFORM --no-use-binaries
2222
script:
2323
- bundle exec rake ci[$PLATFORM]
2424
after_success:

Cartfile.resolved

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "uber/ios-snapshot-test-case" "6.1.0"
1+
github "uber/ios-snapshot-test-case" "6.2.0"

Charts.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "Charts"
3-
s.version = "3.6.0"
3+
s.version = "4.0.0"
44
s.summary = "Charts is a powerful & easy to use chart library for iOS, tvOS and OSX (and Android)"
55
s.homepage = "https://github.com/danielgindi/Charts"
66
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }

Charts.xcodeproj/project.pbxproj

+174-150
Large diffs are not rendered by default.

ChartsDemo-iOS/ChartsDemo-iOS.xcodeproj/project.pbxproj

+13-3
Original file line numberDiff line numberDiff line change
@@ -656,12 +656,12 @@
656656
TargetAttributes = {
657657
225B361C1F6EB9A50005B3D5 = {
658658
CreatedOnToolsVersion = 9.0;
659-
LastSwiftMigration = 1000;
659+
LastSwiftMigration = 1150;
660660
};
661661
5B57BBAE1A9B26AA0036A6CC = {
662662
CreatedOnToolsVersion = 6.1.1;
663-
LastSwiftMigration = 0900;
664-
ProvisioningStyle = Manual;
663+
LastSwiftMigration = 1150;
664+
ProvisioningStyle = Automatic;
665665
};
666666
};
667667
};
@@ -897,6 +897,7 @@
897897
CLANG_WARN_STRICT_PROTOTYPES = YES;
898898
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
899899
DEBUG_INFORMATION_FORMAT = dwarf;
900+
DEVELOPMENT_TEAM = "";
900901
GCC_C_LANGUAGE_STANDARD = gnu11;
901902
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
902903
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
@@ -928,6 +929,7 @@
928929
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
929930
COPY_PHASE_STRIP = NO;
930931
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
932+
DEVELOPMENT_TEAM = "";
931933
GCC_C_LANGUAGE_STANDARD = gnu11;
932934
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
933935
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
@@ -1049,12 +1051,16 @@
10491051
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
10501052
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
10511053
CLANG_ENABLE_MODULES = YES;
1054+
CODE_SIGN_IDENTITY = "Apple Development";
1055+
CODE_SIGN_STYLE = Automatic;
1056+
DEVELOPMENT_TEAM = "";
10521057
FRAMEWORK_SEARCH_PATHS = "$(SOURCE_ROOT)/../Carthage/Build/iOS";
10531058
INFOPLIST_FILE = "Supporting Files/Info.plist";
10541059
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
10551060
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
10561061
PRODUCT_BUNDLE_IDENTIFIER = "com.dcg.$(PRODUCT_NAME:rfc1034identifier)";
10571062
PRODUCT_NAME = "ChartsDemo-iOS";
1063+
PROVISIONING_PROFILE_SPECIFIER = "";
10581064
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos";
10591065
SWIFT_OBJC_BRIDGING_HEADER = "Supporting Files/ChartsDemo-Bridging-Header.h";
10601066
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Swift.h";
@@ -1069,12 +1075,16 @@
10691075
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
10701076
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
10711077
CLANG_ENABLE_MODULES = YES;
1078+
CODE_SIGN_IDENTITY = "Apple Development";
1079+
CODE_SIGN_STYLE = Automatic;
1080+
DEVELOPMENT_TEAM = "";
10721081
FRAMEWORK_SEARCH_PATHS = "$(SOURCE_ROOT)/../Carthage/Build/iOS";
10731082
INFOPLIST_FILE = "Supporting Files/Info.plist";
10741083
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
10751084
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
10761085
PRODUCT_BUNDLE_IDENTIFIER = "com.dcg.$(PRODUCT_NAME:rfc1034identifier)";
10771086
PRODUCT_NAME = "ChartsDemo-iOS";
1087+
PROVISIONING_PROFILE_SPECIFIER = "";
10781088
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos";
10791089
SWIFT_OBJC_BRIDGING_HEADER = "Supporting Files/ChartsDemo-Bridging-Header.h";
10801090
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Swift.h";

ChartsDemo-iOS/Objective-C/Components/XYMarkerView.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import Charts
1212

1313
open class XYMarkerView: BalloonMarker
1414
{
15-
@objc open var xAxisValueFormatter: IAxisValueFormatter?
15+
@objc open var xAxisValueFormatter: AxisValueFormatter?
1616
fileprivate var yFormatter = NumberFormatter()
1717

1818
@objc public init(color: UIColor, font: UIFont, textColor: UIColor, insets: UIEdgeInsets,
19-
xAxisValueFormatter: IAxisValueFormatter)
19+
xAxisValueFormatter: AxisValueFormatter)
2020
{
2121
super.init(color: color, font: font, textColor: textColor, insets: insets)
2222
self.xAxisValueFormatter = xAxisValueFormatter

ChartsDemo-iOS/Objective-C/DemoBaseViewController.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView
7575
{
7676
if ([key isEqualToString:@"toggleValues"])
7777
{
78-
for (id<IChartDataSet> set in chartView.data.dataSets)
78+
for (id<ChartDataSetProtocol> set in chartView.data.dataSets)
7979
{
8080
set.drawValuesEnabled = !set.isDrawValuesEnabled;
8181
}
@@ -85,7 +85,7 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView
8585

8686
if ([key isEqualToString:@"toggleIcons"])
8787
{
88-
for (id<IChartDataSet> set in chartView.data.dataSets)
88+
for (id<ChartDataSetProtocol> set in chartView.data.dataSets)
8989
{
9090
set.drawIconsEnabled = !set.isDrawIconsEnabled;
9191
}
@@ -95,7 +95,7 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView
9595

9696
if ([key isEqualToString:@"toggleHighlight"])
9797
{
98-
chartView.data.highlightEnabled = !chartView.data.isHighlightEnabled;
98+
chartView.data.isHighlightEnabled = !chartView.data.isHighlightEnabled;
9999
[chartView setNeedsDisplay];
100100
}
101101

@@ -143,9 +143,9 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView
143143

144144
if ([key isEqualToString:@"toggleBarBorders"])
145145
{
146-
for (id<IBarChartDataSet, NSObject> set in chartView.data.dataSets)
146+
for (id<BarChartDataSetProtocol, NSObject> set in chartView.data.dataSets)
147147
{
148-
if ([set conformsToProtocol:@protocol(IBarChartDataSet)])
148+
if ([set conformsToProtocol:@protocol(BarChartDataSetProtocol)])
149149
{
150150
set.barBorderWidth = set.barBorderWidth == 1.0 ? 0.0 : 1.0;
151151
}

ChartsDemo-iOS/Objective-C/Demos/CandleStickChartViewController.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ - (void)optionTapped:(NSString *)key
128128
{
129129
if ([key isEqualToString:@"toggleShadowColorSameAsCandle"])
130130
{
131-
for (id<ICandleChartDataSet> set in _chartView.data.dataSets)
131+
for (id<CandleChartDataSetProtocol> set in _chartView.data.dataSets)
132132
{
133133
set.shadowColorSameAsCandle = !set.shadowColorSameAsCandle;
134134
}
@@ -137,7 +137,7 @@ - (void)optionTapped:(NSString *)key
137137
return;
138138
} else if ([key isEqualToString:@"toggleShowCandleBar"])
139139
{
140-
for (id<ICandleChartDataSet> set in _chartView.data.dataSets)
140+
for (id<CandleChartDataSetProtocol> set in _chartView.data.dataSets)
141141
{
142142
set.showCandleBar = !set.showCandleBar;
143143
}

ChartsDemo-iOS/Objective-C/Demos/ColoredLineChartViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ - (void)viewDidLoad
4444

4545
- (void)setupChart:(LineChartView *)chart data:(LineChartData *)data color:(UIColor *)color
4646
{
47-
[(LineChartDataSet *)[data getDataSetByIndex:0] setCircleHoleColor:color];
47+
[(LineChartDataSet *)[data dataSetAtIndex:0] setCircleHoleColor:color];
4848

4949
chart.delegate = self;
5050
chart.backgroundColor = color;

ChartsDemo-iOS/Objective-C/Demos/CombinedChartViewController.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#define ITEM_COUNT 12
1616

17-
@interface CombinedChartViewController () <ChartViewDelegate, IChartAxisValueFormatter>
17+
@interface CombinedChartViewController () <ChartViewDelegate, ChartAxisValueFormatter>
1818
{
1919
NSArray<NSString *> *months;
2020
}
@@ -122,7 +122,7 @@ - (void)optionTapped:(NSString *)key
122122
{
123123
if ([key isEqualToString:@"toggleLineValues"])
124124
{
125-
for (NSObject<IChartDataSet> *set in _chartView.data.dataSets)
125+
for (NSObject<ChartDataSetProtocol> *set in _chartView.data.dataSets)
126126
{
127127
if ([set isKindOfClass:LineChartDataSet.class])
128128
{
@@ -136,7 +136,7 @@ - (void)optionTapped:(NSString *)key
136136

137137
if ([key isEqualToString:@"toggleBarValues"])
138138
{
139-
for (NSObject<IChartDataSet> *set in _chartView.data.dataSets)
139+
for (NSObject<ChartDataSetProtocol> *set in _chartView.data.dataSets)
140140
{
141141
if ([set isKindOfClass:BarChartDataSet.class])
142142
{
@@ -151,7 +151,7 @@ - (void)optionTapped:(NSString *)key
151151
if ([key isEqualToString:@"removeDataSet"])
152152
{
153153
int rnd = (int)arc4random_uniform((float)_chartView.data.dataSetCount);
154-
[_chartView.data removeDataSet:[_chartView.data getDataSetByIndex:rnd]];
154+
[_chartView.data removeDataSet:[_chartView.data dataSetAtIndex:rnd]];
155155
[_chartView.data notifyDataChanged];
156156
[_chartView notifyDataSetChanged];
157157
}
@@ -313,7 +313,7 @@ - (void)chartValueNothingSelected:(ChartViewBase * __nonnull)chartView
313313
NSLog(@"chartValueNothingSelected");
314314
}
315315

316-
#pragma mark - IAxisValueFormatter
316+
#pragma mark - AxisValueFormatter
317317

318318
- (NSString *)stringForValue:(double)value
319319
axis:(ChartAxisBase *)axis

ChartsDemo-iOS/Objective-C/Demos/CubicLineChartViewController.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#import "CubicLineChartViewController.h"
1313
#import "ChartsDemo_iOS-Swift.h"
1414

15-
@interface CubicLineSampleFillFormatter : NSObject <IChartFillFormatter>
15+
@interface CubicLineSampleFillFormatter : NSObject <ChartFillFormatter>
1616
{
1717
}
1818
@end
@@ -158,7 +158,7 @@ - (void)optionTapped:(NSString *)key
158158
{
159159
if ([key isEqualToString:@"toggleFilled"])
160160
{
161-
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
161+
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
162162
{
163163
set.drawFilledEnabled = !set.isDrawFilledEnabled;
164164
}
@@ -169,7 +169,7 @@ - (void)optionTapped:(NSString *)key
169169

170170
if ([key isEqualToString:@"toggleCircles"])
171171
{
172-
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
172+
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
173173
{
174174
set.drawCirclesEnabled = !set.isDrawCirclesEnabled;
175175
}
@@ -180,7 +180,7 @@ - (void)optionTapped:(NSString *)key
180180

181181
if ([key isEqualToString:@"toggleCubic"])
182182
{
183-
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
183+
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
184184
{
185185
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier;
186186
}
@@ -191,7 +191,7 @@ - (void)optionTapped:(NSString *)key
191191

192192
if ([key isEqualToString:@"toggleStepped"])
193193
{
194-
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
194+
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
195195
{
196196
set.mode = set.mode == LineChartModeStepped ? LineChartModeLinear : LineChartModeStepped;
197197
}
@@ -201,7 +201,7 @@ - (void)optionTapped:(NSString *)key
201201

202202
if ([key isEqualToString:@"toggleHorizontalCubic"])
203203
{
204-
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
204+
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
205205
{
206206
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeHorizontalBezier : LineChartModeCubicBezier;
207207
}

ChartsDemo-iOS/Objective-C/Demos/LineChart1ViewController.m

+9-9
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ - (void)viewDidLoad
6161
ChartLimitLine *llXAxis = [[ChartLimitLine alloc] initWithLimit:10.0 label:@"Index 10"];
6262
llXAxis.lineWidth = 4.0;
6363
llXAxis.lineDashLengths = @[@(10.f), @(10.f), @(0.f)];
64-
llXAxis.labelPosition = ChartLimitLabelPositionBottomRight;
64+
llXAxis.labelPosition = ChartLimitLabelPositionRightBottom;
6565
llXAxis.valueFont = [UIFont systemFontOfSize:10.f];
6666

6767
//[_chartView.xAxis addLimitLine:llXAxis];
@@ -72,13 +72,13 @@ - (void)viewDidLoad
7272
ChartLimitLine *ll1 = [[ChartLimitLine alloc] initWithLimit:150.0 label:@"Upper Limit"];
7373
ll1.lineWidth = 4.0;
7474
ll1.lineDashLengths = @[@5.f, @5.f];
75-
ll1.labelPosition = ChartLimitLabelPositionTopRight;
75+
ll1.labelPosition = ChartLimitLabelPositionRightTop;
7676
ll1.valueFont = [UIFont systemFontOfSize:10.0];
7777

7878
ChartLimitLine *ll2 = [[ChartLimitLine alloc] initWithLimit:-30.0 label:@"Lower Limit"];
7979
ll2.lineWidth = 4.0;
8080
ll2.lineDashLengths = @[@5.f, @5.f];
81-
ll2.labelPosition = ChartLimitLabelPositionBottomRight;
81+
ll2.labelPosition = ChartLimitLabelPositionRightBottom;
8282
ll2.valueFont = [UIFont systemFontOfSize:10.0];
8383

8484
ChartYAxis *leftAxis = _chartView.leftAxis;
@@ -174,7 +174,7 @@ - (void)setDataCount:(int)count range:(double)range
174174
CGGradientRef gradient = CGGradientCreateWithColors(nil, (CFArrayRef)gradientColors, nil);
175175

176176
set1.fillAlpha = 1.f;
177-
set1.fill = [ChartFill fillWithLinearGradient:gradient angle:90.f];
177+
set1.fill = [[ChartLinearGradientFill alloc] initWithGradient:gradient angle:90.0f];
178178
set1.drawFilledEnabled = YES;
179179

180180
CGGradientRelease(gradient);
@@ -192,7 +192,7 @@ - (void)optionTapped:(NSString *)key
192192
{
193193
if ([key isEqualToString:@"toggleFilled"])
194194
{
195-
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
195+
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
196196
{
197197
set.drawFilledEnabled = !set.isDrawFilledEnabled;
198198
}
@@ -203,7 +203,7 @@ - (void)optionTapped:(NSString *)key
203203

204204
if ([key isEqualToString:@"toggleCircles"])
205205
{
206-
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
206+
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
207207
{
208208
set.drawCirclesEnabled = !set.isDrawCirclesEnabled;
209209
}
@@ -214,7 +214,7 @@ - (void)optionTapped:(NSString *)key
214214

215215
if ([key isEqualToString:@"toggleCubic"])
216216
{
217-
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
217+
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
218218
{
219219
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeLinear : LineChartModeCubicBezier;
220220
}
@@ -225,7 +225,7 @@ - (void)optionTapped:(NSString *)key
225225

226226
if ([key isEqualToString:@"toggleStepped"])
227227
{
228-
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
228+
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
229229
{
230230
switch (set.mode) {
231231
case LineChartModeLinear:
@@ -242,7 +242,7 @@ - (void)optionTapped:(NSString *)key
242242

243243
if ([key isEqualToString:@"toggleHorizontalCubic"])
244244
{
245-
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
245+
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
246246
{
247247
set.mode = set.mode == LineChartModeHorizontalBezier ? LineChartModeCubicBezier : LineChartModeHorizontalBezier;
248248
}

0 commit comments

Comments
 (0)