Skip to content

Commit

Permalink
Merge branch 'master' into ZebraFork
Browse files Browse the repository at this point in the history
* master:
  update changelog.
  Fixed incorrect guard return statement when rendering limit lines (ChartsOrg#4563)
  Fix bounds checks on binary search (ChartsOrg#4577)
  Added SPM build action (ChartsOrg#4576)
  Replace FBSnapshotTestCase with pointfree/swift-snapshot-testing (ChartsOrg#4574)
  Import swift algorithms (ChartsOrg#4497)
  ChartViewBase cleanup (ChartsOrg#4537)
  SPM GitHub Action (ChartsOrg#4553)
  Algorithm updates (ChartsOrg#3638)
  Added SPM Install section
  Update README.md
  Fix missing drawIconsEnabled parameter initialization in the copying constructor of the ChartBaseDataSet (ChartsOrg#4424)
  Resolve conflict for 4.0 branch and master (ChartsOrg#4456)
  Alternative for SPM dynamic linking (ChartsOrg#4478)
  3.6.0 changelog

# Conflicts:
#	Source/Charts/Renderers/LineChartRenderer.swift
  • Loading branch information
zebraciam committed Jul 6, 2022
2 parents f03e2d6 + e91ba71 commit 6531764
Show file tree
Hide file tree
Showing 516 changed files with 8,007 additions and 5,946 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Swift

on:
push:
branches:
- master
pull_request:
branches:
- '*'

jobs:
iOS:
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
strategy:
matrix:
destination: ["OS=14.4,name=iPhone 12 Pro"] #, "OS=12.4,name=iPhone XS", "OS=11.4,name=iPhone X", "OS=10.3.1,name=iPhone SE"]
steps:
- uses: actions/checkout@v2
- name: iOS - ${{ matrix.destination }}
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Charts.xcworkspace" -scheme "Charts" -destination "${{ matrix.destination }}" clean test | xcpretty

tvOS:
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
strategy:
matrix:
destination: ["OS=14.3,name=Apple TV 4K"]
steps:
- uses: actions/checkout@v2
- name: tvOS - ${{ matrix.destination }}
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Charts.xcworkspace" -scheme "Charts" -destination "${{ matrix.destination }}" clean test | xcpretty

macOS_demo:
runs-on: macOS-latest
env:
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
steps:
- uses: actions/checkout@v2
- name: macOS
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Charts.xcworkspace" -scheme "ChartsDemo-macOS" -destination "platform=macOS" clean build | xcpretty

iOS_demo:
runs-on: macos-latest
env:
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
strategy:
matrix:
destination: ["OS=14.4,name=iPhone 12 Pro"] #, "OS=12.4,name=iPhone XS", "OS=11.4,name=iPhone X", "OS=10.3.1,name=iPhone SE"]
steps:
- uses: actions/checkout@v2
- name: iOS - ${{ matrix.destination }}
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "Charts.xcworkspace" -scheme "ChartsDemo-iOS" -destination "${{ matrix.destination }}" clean build | xcpretty

spm:
name: Test with SPM
runs-on: macOS-latest
env:
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
steps:
- uses: actions/checkout@v2
- name: SPM Test
run: swift build -c debug
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

3,370 changes: 3,357 additions & 13 deletions CHANGELOG.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cartfile.private

This file was deleted.

1 change: 0 additions & 1 deletion Cartfile.resolved

This file was deleted.

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
519 changes: 287 additions & 232 deletions Charts.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions Charts.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"object": {
"pins": [
{
"package": "swift-algorithms",
"repositoryURL": "https://github.com/apple/swift-algorithms",
"state": {
"branch": null,
"revision": "bb3bafeca0e164ece3403a9de646b7d38c07dd49",
"version": "0.0.2"
}
},
{
"package": "swift-numerics",
"repositoryURL": "https://github.com/apple/swift-numerics",
"state": {
"branch": null,
"revision": "6b24333510e9044cf4716a07bed65eeed6bc6393",
"version": "0.0.8"
}
},
{
"package": "SnapshotTesting",
"repositoryURL": "https://github.com/pointfreeco/swift-snapshot-testing",
"state": {
"branch": null,
"revision": "c466812aa2e22898f27557e2e780d3aad7a27203",
"version": "1.8.2"
}
}
]
},
"version": 1
}
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
Loading

0 comments on commit 6531764

Please sign in to comment.