Skip to content

Commit

Permalink
Resolve conflict for 4.0 branch and master (#4456)
Browse files Browse the repository at this point in the history
* Remove java interface convention (#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 (#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 (#3045)

* Fixed using wrong axis (Issue #2257)

* fix #1830. credit from #2049 (#2874)

* fix #1830. credit from #2049

* add combined chart unit tests for iOS, tvOS (macOS only have build process)

* use iterater rather than index

* Removed redundant ivars in BarLineChartViewBase (#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 (#3135)

* Replaced relevant `ChartUtils` methods with `Double` extensions (#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 (#3121)

* add option to build demo projects unit tests on iOS

* add ChartsDemo-OSX build test.

* Update ViewPortHandler.swift (#3143)

fix a small bug

* Refactored ChartUtils method into CGPoint extension (#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 (#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 (#3160)

* Fixed using wrong axis (Issue #2257)

* fix #1830. credit from #2049 (#2874)

* fix #1830. credit from #2049

* add combined chart unit tests for iOS, tvOS (macOS only have build process)

* use iterater rather than index

* Removed redundant ivars in BarLineChartViewBase (#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 (#3135)

* Replaced relevant `ChartUtils` methods with `Double` extensions (#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 (#3121)

* add option to build demo projects unit tests on iOS

* add ChartsDemo-OSX build test.

* Update ViewPortHandler.swift (#3143)

fix a small bug

* Refactored ChartUtils method into CGPoint extension (#3087)

* Refactored ChartUtils method into CGPoint extension

* Replaced ChartUtils.defaultValueFormatter()

* Codestyle fixes

* Minor cleanup to Highlighter types (#3003)

* Minor cleanup to Highlighter types

* Fixes for PR

* Pulled master and updated code style

* added DataApproximator+N extension (#2848)

* added DataApproximator+N extension

* fixed PR notes

* Readded in missing files

* Moved ChartUtils drawing methods into CGContext extension (#3086)

* Fixed using wrong axis (Issue #2257)

* fix #1830. credit from #2049 (#2874)

* fix #1830. credit from #2049

* add combined chart unit tests for iOS, tvOS (macOS only have build process)

* use iterater rather than index

* Removed redundant ivars in BarLineChartViewBase (#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 (#3135)

* Replaced relevant `ChartUtils` methods with `Double` extensions (#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 (#3121)

* add option to build demo projects unit tests on iOS

* add ChartsDemo-OSX build test.

* Update ViewPortHandler.swift (#3143)

fix a small bug

* Refactored ChartUtils method into CGPoint extension (#3087)

* Refactored ChartUtils method into CGPoint extension

* Replaced ChartUtils.defaultValueFormatter()

* Codestyle fixes

* Minor cleanup to Highlighter types (#3003)

* Minor cleanup to Highlighter types

* Fixes for PR

* Pulled master and updated code style

* added DataApproximator+N extension (#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 (#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 #2257)

* fix #1830. credit from #2049 (#2874)

* fix #1830. credit from #2049

* add combined chart unit tests for iOS, tvOS (macOS only have build process)

* use iterater rather than index

* Removed redundant ivars in BarLineChartViewBase (#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 (#3135)

* Replaced relevant `ChartUtils` methods with `Double` extensions (#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 (#3121)

* add option to build demo projects unit tests on iOS

* add ChartsDemo-OSX build test.

* Update ViewPortHandler.swift (#3143)

fix a small bug

* Refactored ChartUtils method into CGPoint extension (#3087)

* Refactored ChartUtils method into CGPoint extension

* Replaced ChartUtils.defaultValueFormatter()

* Codestyle fixes

* Finished cleanup

* Pulled master

* Chartdata collection conformance (#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 (#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 (#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 (#3024)

* Added Collection conformances

MutableCollection
RandomAccessCollection
RangeReplaceableCollection

* [#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 (#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 (#3169)

* Added Collection conformances

MutableCollection
RandomAccessCollection
RangeReplaceableCollection

* [#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 (#3432)

* Dataset logic cleanup (#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

* [#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 (#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 (#3775)

* Cleaned up `ChartDataSet` logic

Added TODOs for areas where simple changes can help improve Swift consistency.

* Added Collection conformances

MutableCollection
RandomAccessCollection
RangeReplaceableCollection

* [#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 (#3084)

close #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 <jchristie@christie.teamspace.ad>
Co-authored-by: Xuan <liuxuan30@gmail.com>

* 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 #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` (#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 <liuxuan30@gmail.com>

* 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 (#4435)

* Remove internal use of datasets (#4459)

* Remove internal use of ChartData.dataSets

* Rebased onto ResolveConflicts

* Remove duplicated line

Co-authored-by: jjatie <j.christie@icloud.com>
Co-authored-by: ctran <chinh.tran@mail.de>
Co-authored-by: larryonoff <larryonoff@gmail.com>
Co-authored-by: Jacob Christie <jakechristie@dal.ca>
Co-authored-by: Katalin Nagy <nagy.katalin@codespring.ro>
Co-authored-by: Pierre-Marc Airoldi <pierremarcairoldi@gmail.com>
Co-authored-by: Marshall Weir <marshall.weir@gmail.com>
Co-authored-by: Jacob Christie <jacob.christie@kinduct.com>
Co-authored-by: Jacob Christie <19879272+jjatie@users.noreply.github.com>
Co-authored-by: Jacob Christie <jchristie@christie.teamspace.ad>
Co-authored-by: BJ Miller <2272819+SixFiveSoftware@users.noreply.github.com>
  • Loading branch information
12 people authored Oct 30, 2020
1 parent ae78bad commit d2bf08f
Show file tree
Hide file tree
Showing 278 changed files with 4,166 additions and 4,688 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: objective-c
osx_image: xcode11
osx_image: xcode12
matrix:
include:
- osx_image: xcode11
- osx_image: xcode12
env: PLATFORM="iOS"
- osx_image: xcode11
- osx_image: xcode12
env: PLATFORM="tvOS"
- osx_image: xcode11
- osx_image: xcode12
env: PLATFORM="macOS"
env:
global:
Expand All @@ -18,7 +18,7 @@ before_install:
- brew update
- brew upgrade carthage || true
- carthage version
- carthage bootstrap --platform $PLATFORM
- ./carthage.sh bootstrap --platform $PLATFORM --no-use-binaries
script:
- bundle exec rake ci[$PLATFORM]
after_success:
Expand Down
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "uber/ios-snapshot-test-case" "6.1.0"
github "uber/ios-snapshot-test-case" "6.2.0"
2 changes: 1 addition & 1 deletion Charts.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Charts"
s.version = "3.6.0"
s.version = "4.0.0"
s.summary = "Charts is a powerful & easy to use chart library for iOS, tvOS and OSX (and Android)"
s.homepage = "https://github.com/danielgindi/Charts"
s.license = { :type => "Apache License, Version 2.0", :file => "LICENSE" }
Expand Down
324 changes: 174 additions & 150 deletions Charts.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions ChartsDemo-iOS/ChartsDemo-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -656,12 +656,12 @@
TargetAttributes = {
225B361C1F6EB9A50005B3D5 = {
CreatedOnToolsVersion = 9.0;
LastSwiftMigration = 1000;
LastSwiftMigration = 1150;
};
5B57BBAE1A9B26AA0036A6CC = {
CreatedOnToolsVersion = 6.1.1;
LastSwiftMigration = 0900;
ProvisioningStyle = Manual;
LastSwiftMigration = 1150;
ProvisioningStyle = Automatic;
};
};
};
Expand Down Expand Up @@ -897,6 +897,7 @@
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
Expand Down Expand Up @@ -928,6 +929,7 @@
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = "";
GCC_C_LANGUAGE_STANDARD = gnu11;
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
Expand Down Expand Up @@ -1049,12 +1051,16 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = "$(SOURCE_ROOT)/../Carthage/Build/iOS";
INFOPLIST_FILE = "Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.dcg.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "ChartsDemo-iOS";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos";
SWIFT_OBJC_BRIDGING_HEADER = "Supporting Files/ChartsDemo-Bridging-Header.h";
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Swift.h";
Expand All @@ -1069,12 +1075,16 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = "$(SOURCE_ROOT)/../Carthage/Build/iOS";
INFOPLIST_FILE = "Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.dcg.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "ChartsDemo-iOS";
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos";
SWIFT_OBJC_BRIDGING_HEADER = "Supporting Files/ChartsDemo-Bridging-Header.h";
SWIFT_OBJC_INTERFACE_HEADER_NAME = "$(SWIFT_MODULE_NAME)-Swift.h";
Expand Down
4 changes: 2 additions & 2 deletions ChartsDemo-iOS/Objective-C/Components/XYMarkerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import Charts

open class XYMarkerView: BalloonMarker
{
@objc open var xAxisValueFormatter: IAxisValueFormatter?
@objc open var xAxisValueFormatter: AxisValueFormatter?
fileprivate var yFormatter = NumberFormatter()

@objc public init(color: UIColor, font: UIFont, textColor: UIColor, insets: UIEdgeInsets,
xAxisValueFormatter: IAxisValueFormatter)
xAxisValueFormatter: AxisValueFormatter)
{
super.init(color: color, font: font, textColor: textColor, insets: insets)
self.xAxisValueFormatter = xAxisValueFormatter
Expand Down
10 changes: 5 additions & 5 deletions ChartsDemo-iOS/Objective-C/DemoBaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView
{
if ([key isEqualToString:@"toggleValues"])
{
for (id<IChartDataSet> set in chartView.data.dataSets)
for (id<ChartDataSetProtocol> set in chartView.data.dataSets)
{
set.drawValuesEnabled = !set.isDrawValuesEnabled;
}
Expand All @@ -85,7 +85,7 @@ - (void)handleOption:(NSString *)key forChartView:(ChartViewBase *)chartView

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

if ([key isEqualToString:@"toggleHighlight"])
{
chartView.data.highlightEnabled = !chartView.data.isHighlightEnabled;
chartView.data.isHighlightEnabled = !chartView.data.isHighlightEnabled;
[chartView setNeedsDisplay];
}

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

if ([key isEqualToString:@"toggleBarBorders"])
{
for (id<IBarChartDataSet, NSObject> set in chartView.data.dataSets)
for (id<BarChartDataSetProtocol, NSObject> set in chartView.data.dataSets)
{
if ([set conformsToProtocol:@protocol(IBarChartDataSet)])
if ([set conformsToProtocol:@protocol(BarChartDataSetProtocol)])
{
set.barBorderWidth = set.barBorderWidth == 1.0 ? 0.0 : 1.0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleShadowColorSameAsCandle"])
{
for (id<ICandleChartDataSet> set in _chartView.data.dataSets)
for (id<CandleChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.shadowColorSameAsCandle = !set.shadowColorSameAsCandle;
}
Expand All @@ -137,7 +137,7 @@ - (void)optionTapped:(NSString *)key
return;
} else if ([key isEqualToString:@"toggleShowCandleBar"])
{
for (id<ICandleChartDataSet> set in _chartView.data.dataSets)
for (id<CandleChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.showCandleBar = !set.showCandleBar;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ - (void)viewDidLoad

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

chart.delegate = self;
chart.backgroundColor = color;
Expand Down
10 changes: 5 additions & 5 deletions ChartsDemo-iOS/Objective-C/Demos/CombinedChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#define ITEM_COUNT 12

@interface CombinedChartViewController () <ChartViewDelegate, IChartAxisValueFormatter>
@interface CombinedChartViewController () <ChartViewDelegate, ChartAxisValueFormatter>
{
NSArray<NSString *> *months;
}
Expand Down Expand Up @@ -122,7 +122,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleLineValues"])
{
for (NSObject<IChartDataSet> *set in _chartView.data.dataSets)
for (NSObject<ChartDataSetProtocol> *set in _chartView.data.dataSets)
{
if ([set isKindOfClass:LineChartDataSet.class])
{
Expand All @@ -136,7 +136,7 @@ - (void)optionTapped:(NSString *)key

if ([key isEqualToString:@"toggleBarValues"])
{
for (NSObject<IChartDataSet> *set in _chartView.data.dataSets)
for (NSObject<ChartDataSetProtocol> *set in _chartView.data.dataSets)
{
if ([set isKindOfClass:BarChartDataSet.class])
{
Expand All @@ -151,7 +151,7 @@ - (void)optionTapped:(NSString *)key
if ([key isEqualToString:@"removeDataSet"])
{
int rnd = (int)arc4random_uniform((float)_chartView.data.dataSetCount);
[_chartView.data removeDataSet:[_chartView.data getDataSetByIndex:rnd]];
[_chartView.data removeDataSet:[_chartView.data dataSetAtIndex:rnd]];
[_chartView.data notifyDataChanged];
[_chartView notifyDataSetChanged];
}
Expand Down Expand Up @@ -313,7 +313,7 @@ - (void)chartValueNothingSelected:(ChartViewBase * __nonnull)chartView
NSLog(@"chartValueNothingSelected");
}

#pragma mark - IAxisValueFormatter
#pragma mark - AxisValueFormatter

- (NSString *)stringForValue:(double)value
axis:(ChartAxisBase *)axis
Expand Down
12 changes: 6 additions & 6 deletions ChartsDemo-iOS/Objective-C/Demos/CubicLineChartViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "CubicLineChartViewController.h"
#import "ChartsDemo_iOS-Swift.h"

@interface CubicLineSampleFillFormatter : NSObject <IChartFillFormatter>
@interface CubicLineSampleFillFormatter : NSObject <ChartFillFormatter>
{
}
@end
Expand Down Expand Up @@ -158,7 +158,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleFilled"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawFilledEnabled = !set.isDrawFilledEnabled;
}
Expand All @@ -169,7 +169,7 @@ - (void)optionTapped:(NSString *)key

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

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

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

if ([key isEqualToString:@"toggleHorizontalCubic"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeCubicBezier ? LineChartModeHorizontalBezier : LineChartModeCubicBezier;
}
Expand Down
18 changes: 9 additions & 9 deletions ChartsDemo-iOS/Objective-C/Demos/LineChart1ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ - (void)viewDidLoad
ChartLimitLine *llXAxis = [[ChartLimitLine alloc] initWithLimit:10.0 label:@"Index 10"];
llXAxis.lineWidth = 4.0;
llXAxis.lineDashLengths = @[@(10.f), @(10.f), @(0.f)];
llXAxis.labelPosition = ChartLimitLabelPositionBottomRight;
llXAxis.labelPosition = ChartLimitLabelPositionRightBottom;
llXAxis.valueFont = [UIFont systemFontOfSize:10.f];

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

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

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

set1.fillAlpha = 1.f;
set1.fill = [ChartFill fillWithLinearGradient:gradient angle:90.f];
set1.fill = [[ChartLinearGradientFill alloc] initWithGradient:gradient angle:90.0f];
set1.drawFilledEnabled = YES;

CGGradientRelease(gradient);
Expand All @@ -192,7 +192,7 @@ - (void)optionTapped:(NSString *)key
{
if ([key isEqualToString:@"toggleFilled"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.drawFilledEnabled = !set.isDrawFilledEnabled;
}
Expand All @@ -203,7 +203,7 @@ - (void)optionTapped:(NSString *)key

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

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

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

if ([key isEqualToString:@"toggleHorizontalCubic"])
{
for (id<ILineChartDataSet> set in _chartView.data.dataSets)
for (id<LineChartDataSetProtocol> set in _chartView.data.dataSets)
{
set.mode = set.mode == LineChartModeHorizontalBezier ? LineChartModeCubicBezier : LineChartModeHorizontalBezier;
}
Expand Down
Loading

0 comments on commit d2bf08f

Please sign in to comment.