diff --git a/.github/workflows/swift.yml b/.github/workflows/build.yml similarity index 98% rename from .github/workflows/swift.yml rename to .github/workflows/build.yml index 9ed2deeacb..658a16d1e2 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Swift +name: Build on: workflow_dispatch: @@ -77,5 +77,5 @@ jobs: DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer steps: - uses: actions/checkout@v3 - - name: Carthage Test + - name: Cocoapdos Test run: pod lib lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..30f4be14b8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +name: Release + +on: + workflow_dispatch: + push: + tags: + - "*" + +jobs: + build: + runs-on: macos-12 + + steps: + - uses: actions/checkout@v1 + + - name: Install Cocoapods + run: gem install cocoapods + + - name: Deploy to Cocoapods + run: | + set -eo pipefail + pod lib lint --allow-warnings + pod trunk push --allow-warnings + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} diff --git a/Charts.xcodeproj/project.pbxproj b/Charts.xcodeproj/project.pbxproj index 4f4bd31bf6..dc4108ab83 100644 --- a/Charts.xcodeproj/project.pbxproj +++ b/Charts.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 53; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -51,6 +51,7 @@ 3395682A1E27756651FF6F4D /* BarChartData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0108D5925E21A47DA36A66AA /* BarChartData.swift */; }; 369DEB23452CB436A3A1A644 /* MarkerImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392AAEB02DD7B351D92907C2 /* MarkerImage.swift */; }; 383D68A13E1C3D6A251E5147 /* CandleChartDataSet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274116834B1B0345D622E027 /* CandleChartDataSet.swift */; }; + 39279C482B6B643600204A3D /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 3959DF712B4BD33000A20423 /* PrivacyInfo.xcprivacy */; }; 3B11556EB7DC034E2FC958E4 /* BarChartTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C3F5E1A69EC06E86505F7B1 /* BarChartTests.swift */; }; 3CBE95F1E9394FA08CDCF31E /* BarHighlighter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 543729805D897CC03E5F78D3 /* BarHighlighter.swift */; }; 40C82F2209E1BA9E41E8F3DA /* ChartColorTemplates.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6227A646166E248F90F86AD /* ChartColorTemplates.swift */; }; @@ -217,6 +218,7 @@ 32FC01A016DFF1BA73AF9182 /* SquareShapeRenderer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SquareShapeRenderer.swift; path = Source/Charts/Renderers/Scatter/SquareShapeRenderer.swift; sourceTree = ""; }; 33BE9A97FFA41D3D85CAFFC7 /* HorizontalBarHighlighter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HorizontalBarHighlighter.swift; path = Source/Charts/Highlight/HorizontalBarHighlighter.swift; sourceTree = ""; }; 392AAEB02DD7B351D92907C2 /* MarkerImage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MarkerImage.swift; path = Source/Charts/Components/MarkerImage.swift; sourceTree = ""; }; + 3959DF712B4BD33000A20423 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = Source/Charts/PrivacyInfo.xcprivacy; sourceTree = ""; }; 3976E5F9D60E30CD94CE6156 /* Animator.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Animator.swift; path = Source/Charts/Animation/Animator.swift; sourceTree = ""; }; 3A32510073A303CBB38E094A /* ChartDataSetProtocol.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ChartDataSetProtocol.swift; path = Source/Charts/Data/Interfaces/ChartDataSetProtocol.swift; sourceTree = ""; }; 3D64616883374310C505EC39 /* Highlight.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Highlight.swift; path = Source/Charts/Highlight/Highlight.swift; sourceTree = ""; }; @@ -486,6 +488,7 @@ AD1224C45A29A5C88D6B7450 /* Jobs */, E7589D3E7C2BD2449960AD59 /* Renderers */, D047819AB7170595896D6FE8 /* Utils */, + 3959DF712B4BD33000A20423 /* PrivacyInfo.xcprivacy */, ); name = Charts; sourceTree = ""; @@ -837,6 +840,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 39279C482B6B643600204A3D /* PrivacyInfo.xcprivacy in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1047,7 +1051,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; - MARKETING_VERSION = 5.0.0; + MARKETING_VERSION = 5.1.0; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; MTL_ENABLE_DEBUG_INFO = YES; @@ -1240,7 +1244,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; - MARKETING_VERSION = 5.0.0; + MARKETING_VERSION = 5.1.0; MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; MTL_ENABLE_DEBUG_INFO = NO; diff --git a/DGCharts.podspec b/DGCharts.podspec index d8a1c6c115..7ba0dea717 100644 --- a/DGCharts.podspec +++ b/DGCharts.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "DGCharts" - s.version = "5.0.0" + s.version = "5.1.0" s.summary = "DGCharts 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" } @@ -8,11 +8,13 @@ Pod::Spec.new do |s| s.ios.deployment_target = "12.0" s.tvos.deployment_target = "12.0" s.osx.deployment_target = "10.13" - s.source = { :git => "https://github.com/danielgindi/Charts.git", :tag => "v#{s.version}" } + s.source = { :git => "https://github.com/danielgindi/Charts.git", :tag => "#{s.version}" } s.default_subspec = "Core" s.swift_version = '5.7' s.cocoapods_version = '>= 1.5.0' + s.resource_bundles = {"DGCharts" => ["Source/Charts/PrivacyInfo.xcprivacy"]} + s.subspec "Core" do |ss| ss.source_files = "Source/Charts/**/*.swift" end diff --git a/Package.swift b/Package.swift index 85a790bbd1..8eee46ebc9 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.1 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -21,7 +21,8 @@ let package = Package( targets: [ .target( name: "DGCharts", - path: "Source/Charts" + path: "Source/Charts", + resources: [.copy("PrivacyInfo.xcprivacy")] ) ], swiftLanguageVersions: [.v5] diff --git a/README.md b/README.md index 6a403f8f68..d769655151 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![Supported Platforms](https://img.shields.io/cocoapods/p/Charts.svg) [![Releases](https://img.shields.io/github/release/danielgindi/Charts.svg)](https://github.com/danielgindi/Charts/releases) [![Latest pod release](https://img.shields.io/cocoapods/v/Charts.svg)](http://cocoapods.org/pods/charts) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/danielgindi/Charts.svg?branch=master)](https://travis-ci.org/danielgindi/Charts) [![codecov](https://codecov.io/gh/danielgindi/Charts/branch/master/graph/badge.svg)](https://codecov.io/gh/danielgindi/Charts) [![Join the chat at https://gitter.im/danielgindi/Charts](https://badges.gitter.im/danielgindi/Charts.svg)](https://gitter.im/danielgindi/Charts?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -### Just a heads up: Charts 5.0 has some breaking changes. Charts has now been renamed DGCharts to prevent conflicts with Apple's new Swift Charts. Please read [the release/migration notes](https://github.com/danielgindi/Charts/releases/tag/v5.0.0). +### Just a heads up: Charts 5.0 has some breaking changes. Charts has now been renamed DGCharts to prevent conflicts with Apple's new Swift Charts. Please read [the release/migration notes](https://github.com/danielgindi/Charts/releases/tag/5.0.0). ### One more heads up: As Swift evolves, if you are not using the latest Swift compiler, you shouldn't check out the master branch. Instead, you should go to the release page and pick up whatever suits you. @@ -93,8 +93,8 @@ For [Realm](https://realm.io/) support, please add `pod 'ChartsRealm'` too. DGCharts now include Carthage prebuilt binaries. ```carthage -github "danielgindi/DGCharts" == 5.0.0 -github "danielgindi/DGCharts" ~> 5.0.0 +github "danielgindi/Charts" == 5.1.0 +github "danielgindi/Charts" ~> 5.1.0 ``` In order to build the binaries for a new release, use `carthage build --no-skip-current && carthage archive Charts`. @@ -105,7 +105,7 @@ Swift Package Manager ```swift dependencies: [ - .package(url: "https://github.com/danielgindi/Charts.git", .upToNextMajor(from: "5.0.0")) + .package(url: "https://github.com/danielgindi/Charts.git", .upToNextMajor(from: "5.1.0")) ] ``` diff --git a/Source/Charts/Components/ChartLimitLine.swift b/Source/Charts/Components/ChartLimitLine.swift index 2dc35dbe55..26ad7bc6a5 100644 --- a/Source/Charts/Components/ChartLimitLine.swift +++ b/Source/Charts/Components/ChartLimitLine.swift @@ -47,6 +47,7 @@ open class ChartLimitLine: ComponentBase @objc open var drawLabelEnabled = true @objc open var label = "" @objc open var labelPosition = LabelPosition.rightTop + @objc open var labelRotationAngle = CGFloat(0.0) public override init() { diff --git a/Source/Charts/PrivacyInfo.xcprivacy b/Source/Charts/PrivacyInfo.xcprivacy new file mode 100644 index 0000000000..6af16412a0 --- /dev/null +++ b/Source/Charts/PrivacyInfo.xcprivacy @@ -0,0 +1,14 @@ + + + + + NSPrivacyTracking + + NSPrivacyCollectedDataTypes + + NSPrivacyTrackingDomains + + NSPrivacyAccessedAPITypes + + + diff --git a/Source/Charts/Renderers/XAxisRenderer.swift b/Source/Charts/Renderers/XAxisRenderer.swift index 966bf3b7e1..99fbf8c377 100644 --- a/Source/Charts/Renderers/XAxisRenderer.swift +++ b/Source/Charts/Renderers/XAxisRenderer.swift @@ -449,40 +449,45 @@ open class XAxisRenderer: NSObject, AxisRenderer // if drawing the limit-value label is enabled guard limitLine.drawLabelEnabled, !label.isEmpty else { return } - let labelLineHeight = limitLine.valueFont.lineHeight + let labelLineSize = label.size(withAttributes: [.font: limitLine.valueFont]) + let labelLineRotatedSize = labelLineSize.rotatedBy(degrees: limitLine.labelRotationAngle) + let labelLineRotatedWidth = labelLineRotatedSize.width + let labelLineRotatedHeight = labelLineRotatedSize.height let xOffset: CGFloat = limitLine.lineWidth + limitLine.xOffset + let labelRotationAngleRadians = limitLine.labelRotationAngle.DEG2RAD - let align: TextAlignment let point: CGPoint + let anchor = CGPoint(x: 0.0, y: 0.0) - switch limitLine.labelPosition - { + switch limitLine.labelPosition { case .rightTop: - align = .left - point = CGPoint(x: position.x + xOffset, - y: viewPortHandler.contentTop + yOffset) + point = CGPoint( + x: position.x + xOffset, + y: viewPortHandler.contentTop + yOffset) case .rightBottom: - align = .left point = CGPoint(x: position.x + xOffset, - y: viewPortHandler.contentBottom - labelLineHeight - yOffset) + y: viewPortHandler.contentBottom - labelLineRotatedHeight - yOffset) case .leftTop: - align = .right - point = CGPoint(x: position.x - xOffset, + point = CGPoint(x: position.x - labelLineRotatedWidth - xOffset, y: viewPortHandler.contentTop + yOffset) case .leftBottom: - align = .right - point = CGPoint(x: position.x - xOffset, - y: viewPortHandler.contentBottom - labelLineHeight - yOffset) + point = CGPoint(x: position.x - labelLineRotatedWidth - xOffset, + y: viewPortHandler.contentBottom - labelLineRotatedHeight - yOffset) } + let attributes: [NSAttributedString.Key : Any] = [ + .font: limitLine.valueFont, + .foregroundColor: limitLine.valueTextColor + ] + context.drawText(label, at: point, - align: align, - attributes: [.font: limitLine.valueFont, - .foregroundColor: limitLine.valueTextColor]) + anchor: anchor, + angleRadians: labelRotationAngleRadians, + attributes: attributes) } } diff --git a/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift b/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift index a7429dbb69..652f11f508 100644 --- a/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift +++ b/Source/Charts/Renderers/XAxisRendererHorizontalBarChart.swift @@ -249,41 +249,48 @@ open class XAxisRendererHorizontalBarChart: XAxisRenderer // if drawing the limit-value label is enabled if l.drawLabelEnabled, !label.isEmpty { - let labelLineHeight = l.valueFont.lineHeight - + + let labelLineSize = label.size(withAttributes: [.font: l.valueFont]) + let labelLineRotatedSize = labelLineSize.rotatedBy(degrees: l.labelRotationAngle) + let labelLineRotatedWidth = labelLineRotatedSize.width + let labelLineRotatedHeight = labelLineRotatedSize.height + let xOffset = 4.0 + l.xOffset - let yOffset = l.lineWidth + labelLineHeight + l.yOffset + let yOffset = l.lineWidth + labelLineRotatedHeight + l.yOffset + let labelRotationAngleRadians = l.labelRotationAngle.DEG2RAD - let align: TextAlignment let point: CGPoint + let anchor = CGPoint(x: 0.0, y: 0.0) switch l.labelPosition { case .rightTop: - align = .right - point = CGPoint(x: viewPortHandler.contentRight - xOffset, + point = CGPoint(x: viewPortHandler.contentRight - labelLineRotatedWidth - xOffset, y: position.y - yOffset) case .rightBottom: - align = .right - point = CGPoint(x: viewPortHandler.contentRight - xOffset, - y: position.y + yOffset - labelLineHeight) + point = CGPoint(x: viewPortHandler.contentRight - labelLineRotatedWidth - xOffset, + y: position.y - labelLineRotatedHeight + yOffset) case .leftTop: - align = .left point = CGPoint(x: viewPortHandler.contentLeft + xOffset, y: position.y - yOffset) case .leftBottom: - align = .left point = CGPoint(x: viewPortHandler.contentLeft + xOffset, - y: position.y + yOffset - labelLineHeight) + y: position.y - labelLineRotatedHeight + yOffset) } + let attributes: [NSAttributedString.Key : Any] = [ + .font: l.valueFont, + .foregroundColor: l.valueTextColor + ] + context.drawText(label, at: point, - align: align, - attributes: [.font: l.valueFont, .foregroundColor: l.valueTextColor]) + anchor: anchor, + angleRadians: labelRotationAngleRadians, + attributes: attributes) } } } diff --git a/Source/Charts/Renderers/YAxisRenderer.swift b/Source/Charts/Renderers/YAxisRenderer.swift index 7175ff1633..4811a3ed9e 100644 --- a/Source/Charts/Renderers/YAxisRenderer.swift +++ b/Source/Charts/Renderers/YAxisRenderer.swift @@ -295,41 +295,47 @@ open class YAxisRenderer: NSObject, AxisRenderer // if drawing the limit-value label is enabled guard l.drawLabelEnabled, !label.isEmpty else { continue } - let labelLineHeight = l.valueFont.lineHeight - + let labelLineSize = label.size(withAttributes: [.font: l.valueFont]) + let labelLineRotatedSize = labelLineSize.rotatedBy(degrees: l.labelRotationAngle) + let labelLineRotatedWidth = labelLineRotatedSize.width + let labelLineRotatedHeight = labelLineRotatedSize.height + let xOffset = 4.0 + l.xOffset - let yOffset = l.lineWidth + labelLineHeight + l.yOffset + let yOffset = l.lineWidth + labelLineRotatedHeight + l.yOffset + let labelRotationAngleRadians = l.labelRotationAngle.DEG2RAD - let align: TextAlignment let point: CGPoint + let anchor = CGPoint(x: 0.0, y: 0.0) switch l.labelPosition { case .rightTop: - align = .right - point = CGPoint(x: viewPortHandler.contentRight - xOffset, + point = CGPoint(x: viewPortHandler.contentRight - labelLineRotatedWidth - xOffset, y: position.y - yOffset) case .rightBottom: - align = .right - point = CGPoint(x: viewPortHandler.contentRight - xOffset, - y: position.y + yOffset - labelLineHeight) + point = CGPoint(x: viewPortHandler.contentRight - labelLineRotatedWidth - xOffset, + y: position.y - labelLineRotatedHeight + yOffset) case .leftTop: - align = .left point = CGPoint(x: viewPortHandler.contentLeft + xOffset, y: position.y - yOffset) case .leftBottom: - align = .left point = CGPoint(x: viewPortHandler.contentLeft + xOffset, - y: position.y + yOffset - labelLineHeight) + y: position.y - labelLineRotatedHeight + yOffset) } + let attributes: [NSAttributedString.Key : Any] = [ + .font: l.valueFont, + .foregroundColor: l.valueTextColor + ] + context.drawText(label, at: point, - align: align, - attributes: [.font: l.valueFont, .foregroundColor: l.valueTextColor]) + anchor: anchor, + angleRadians: labelRotationAngleRadians, + attributes: attributes) } } diff --git a/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift b/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift index f4aa877d0a..ad688a26ad 100644 --- a/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift +++ b/Source/Charts/Renderers/YAxisRendererHorizontalBarChart.swift @@ -253,41 +253,47 @@ open class YAxisRendererHorizontalBarChart: YAxisRenderer // if drawing the limit-value label is enabled if l.drawLabelEnabled, !label.isEmpty { - let labelLineHeight = l.valueFont.lineHeight - + let labelLineSize = label.size(withAttributes: [.font: l.valueFont]) + let labelLineRotatedSize = labelLineSize.rotatedBy(degrees: l.labelRotationAngle) + let labelLineRotatedWidth = labelLineRotatedSize.width + let labelLineRotatedHeight = labelLineRotatedSize.height + let xOffset = l.lineWidth + l.xOffset let yOffset = 2.0 + l.yOffset + let labelRotationAngleRadians = l.labelRotationAngle.DEG2RAD - let align: TextAlignment let point: CGPoint + let anchor = CGPoint(x: 0.0, y: 0.0) switch l.labelPosition { case .rightTop: - align = .left point = CGPoint(x: position.x + xOffset, y: viewPortHandler.contentTop + yOffset) case .rightBottom: - align = .left point = CGPoint(x: position.x + xOffset, - y: viewPortHandler.contentBottom - labelLineHeight - yOffset) + y: viewPortHandler.contentBottom - labelLineRotatedHeight - yOffset) case .leftTop: - align = .right - point = CGPoint(x: position.x - xOffset, + point = CGPoint(x: position.x - labelLineRotatedWidth - xOffset, y: viewPortHandler.contentTop + yOffset) case .leftBottom: - align = .right - point = CGPoint(x: position.x - xOffset, - y: viewPortHandler.contentBottom - labelLineHeight - yOffset) + point = CGPoint(x: position.x - labelLineRotatedWidth - xOffset, + y: viewPortHandler.contentBottom - labelLineRotatedHeight - yOffset) } + let attributes: [NSAttributedString.Key : Any] = [ + .font: l.valueFont, + .foregroundColor: l.valueTextColor + ] + context.drawText(label, at: point, - align: align, - attributes: [.font: l.valueFont, .foregroundColor: l.valueTextColor]) + anchor: anchor, + angleRadians: labelRotationAngleRadians, + attributes: attributes) } } } diff --git a/Tests/ChartsTests/LineChartTests.swift b/Tests/ChartsTests/LineChartTests.swift index 824398d514..6da4524ef6 100755 --- a/Tests/ChartsTests/LineChartTests.swift +++ b/Tests/ChartsTests/LineChartTests.swift @@ -69,4 +69,41 @@ class LineChartTests: XCTestCase { dataSet.drawIconsEnabled = true assertChartSnapshot(matching: chart) } + + func testLimitLineLabelRotatedBy180() { + addLimitLineWithRotatedAngle(labelPosition: .rightBottom, labelRotationAngle: 180) + assertChartSnapshot(matching: chart) + } + + func testLimitLineLabelRotatedBy120() { + addLimitLineWithRotatedAngle(labelPosition: .rightTop, labelRotationAngle: 120) + assertChartSnapshot(matching: chart) + } + + func testLimitLineLabelRotatedBy90() { + addLimitLineWithRotatedAngle(labelPosition: .leftTop, labelRotationAngle: 90) + assertChartSnapshot(matching: chart) + } + + func testLimitLineLabelRotatedBy45() { + addLimitLineWithRotatedAngle(labelPosition: .leftBottom, labelRotationAngle: 45) + assertChartSnapshot(matching: chart) + } + + func testLimitLineLabelRotatedBy30() { + addLimitLineWithRotatedAngle(labelPosition: .leftBottom, labelRotationAngle: 30) + assertChartSnapshot(matching: chart) + } + + func testLimitLineLabelDefaultRotation() { + addLimitLineWithRotatedAngle(labelPosition: .rightTop, labelRotationAngle: 0) + assertChartSnapshot(matching: chart) + } + + private func addLimitLineWithRotatedAngle(labelPosition: ChartLimitLine.LabelPosition, labelRotationAngle: CGFloat) { + let limitline = ChartLimitLine(limit: 50, label: "Limit Line") + limitline.labelPosition = labelPosition + limitline.labelRotationAngle = labelRotationAngle + chart.leftAxis.addLimitLine(limitline) + } } diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelDefaultRotation-iOS_414-0_896-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelDefaultRotation-iOS_414-0_896-0.1.png new file mode 100644 index 0000000000..d576ceab27 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelDefaultRotation-iOS_414-0_896-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelDefaultRotation-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelDefaultRotation-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..710c79f3d0 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelDefaultRotation-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy120-iOS_414-0_896-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy120-iOS_414-0_896-0.1.png new file mode 100644 index 0000000000..5d1f18a8e1 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy120-iOS_414-0_896-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy120-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy120-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..c79edc589a Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy120-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy180-iOS_414-0_896-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy180-iOS_414-0_896-0.1.png new file mode 100644 index 0000000000..ef67a45800 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy180-iOS_414-0_896-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy180-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy180-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..dadeb4194f Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy180-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy30-iOS_414-0_896-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy30-iOS_414-0_896-0.1.png new file mode 100644 index 0000000000..d2d3c1ce75 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy30-iOS_414-0_896-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy30-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy30-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..55f49ece5f Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy30-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy45-iOS_414-0_896-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy45-iOS_414-0_896-0.1.png new file mode 100644 index 0000000000..e17a810401 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy45-iOS_414-0_896-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy45-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy45-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..1668805034 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy45-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy90-iOS_414-0_896-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy90-iOS_414-0_896-0.1.png new file mode 100644 index 0000000000..b8acda2ebc Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy90-iOS_414-0_896-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy90-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy90-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..235525a5b4 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__AppleSilicon__/LineChartTests/testLimitLineLabelRotatedBy90-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelDefaultRotation-iOS_393-0_852-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelDefaultRotation-iOS_393-0_852-0.1.png new file mode 100644 index 0000000000..50c0c2733b Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelDefaultRotation-iOS_393-0_852-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelDefaultRotation-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelDefaultRotation-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..5c5f2299be Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelDefaultRotation-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy120-iOS_393-0_852-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy120-iOS_393-0_852-0.1.png new file mode 100644 index 0000000000..f1e6385408 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy120-iOS_393-0_852-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy120-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy120-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..3878ca7460 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy120-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy180-iOS_393-0_852-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy180-iOS_393-0_852-0.1.png new file mode 100644 index 0000000000..f2f50f6d55 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy180-iOS_393-0_852-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy180-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy180-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..9fbc289c3c Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy180-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy30-iOS_393-0_852-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy30-iOS_393-0_852-0.1.png new file mode 100644 index 0000000000..8806c3254c Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy30-iOS_393-0_852-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy30-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy30-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..dda456717f Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy30-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy45-iOS_393-0_852-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy45-iOS_393-0_852-0.1.png new file mode 100644 index 0000000000..b58d3662a7 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy45-iOS_393-0_852-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy45-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy45-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..a5c235f09f Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy45-tvOS_1920-0_1080-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy90-iOS_393-0_852-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy90-iOS_393-0_852-0.1.png new file mode 100644 index 0000000000..a719aca904 Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy90-iOS_393-0_852-0.1.png differ diff --git a/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy90-tvOS_1920-0_1080-0.1.png b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy90-tvOS_1920-0_1080-0.1.png new file mode 100644 index 0000000000..685787b7de Binary files /dev/null and b/Tests/ChartsTests/__Snapshots__x86__/LineChartTests/testLimitLineLabelRotatedBy90-tvOS_1920-0_1080-0.1.png differ