forked from ChartsOrg/Charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ChartsOrg#1 from danielgindi/master
Update forked repo
- Loading branch information
Showing
195 changed files
with
1,540 additions
and
4,029 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# These are supported funding model platforms | ||
|
||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] | ||
patreon: # Replace with username | ||
open_collective: charts | ||
ko_fi: # Replace with a single Ko-fi username | ||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel | ||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry | ||
liberapay: # Replace with a single Liberapay username | ||
issuehunt: # Replace with a single IssueHunt username | ||
otechie: # Replace with a single Otechie username | ||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,3 +72,4 @@ fastlane/test_output | |
Carthage | ||
Charts.framework.zip | ||
ChartsRealm.framework.zip | ||
.swiftpm/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
github "uber/ios-snapshot-test-case" "6.0.3" | ||
github "uber/ios-snapshot-test-case" "6.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// | ||
// ChartDataTests.swift | ||
// ChartsTests | ||
// | ||
// Created by Peter Kaminski on 1/23/20. | ||
// | ||
|
||
import XCTest | ||
@testable import Charts | ||
|
||
class ChartDataTests: XCTestCase { | ||
|
||
var data: ScatterChartData! | ||
|
||
private enum SetLabels { | ||
static let one = "label1" | ||
static let two = "label2" | ||
static let three = "label3" | ||
static let badLabel = "Bad label" | ||
} | ||
|
||
override func setUp() { | ||
super.setUp() | ||
|
||
let setCount = 5 | ||
let range: UInt32 = 32 | ||
let values1 = (0..<setCount).map { (i) -> ChartDataEntry in | ||
let val = Double(arc4random_uniform(range) + 3) | ||
return ChartDataEntry(x: Double(i), y: val) | ||
} | ||
let values2 = (0..<setCount).map { (i) -> ChartDataEntry in | ||
let val = Double(arc4random_uniform(range) + 3) | ||
return ChartDataEntry(x: Double(i), y: val) | ||
} | ||
let values3 = (0..<setCount).map { (i) -> ChartDataEntry in | ||
let val = Double(arc4random_uniform(range) + 3) | ||
return ChartDataEntry(x: Double(i), y: val) | ||
} | ||
|
||
let set1 = ScatterChartDataSet(entries: values1, label: SetLabels.one) | ||
let set2 = ScatterChartDataSet(entries: values2, label: SetLabels.two) | ||
let set3 = ScatterChartDataSet(entries: values3, label: SetLabels.three) | ||
|
||
data = ScatterChartData(dataSets: [set1, set2, set3]) | ||
} | ||
|
||
func testGetDataSetByLabelCaseSensitive() { | ||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.one, ignorecase: false)?.label == SetLabels.one) | ||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.two, ignorecase: false)?.label == SetLabels.two) | ||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.three, ignorecase: false)?.label == SetLabels.three) | ||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.one.uppercased(), ignorecase: false) == nil) | ||
} | ||
|
||
func testGetDataSetByLabelIgnoreCase() { | ||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.one, ignorecase: true)?.label == SetLabels.one) | ||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.two, ignorecase: true)?.label == SetLabels.two) | ||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.three, ignorecase: true)?.label == SetLabels.three) | ||
|
||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.one.uppercased(), ignorecase: true)?.label == SetLabels.one) | ||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.two.uppercased(), ignorecase: true)?.label == SetLabels.two) | ||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.three.uppercased(), ignorecase: true)?.label == SetLabels.three) | ||
} | ||
|
||
func testGetDataSetByLabelNilWithBadLabel() { | ||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.badLabel, ignorecase: true) == nil) | ||
XCTAssertTrue(data.getDataSetByLabel(SetLabels.badLabel, ignorecase: false) == nil) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.