-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Description
- I've read, understood, and done my best to follow the *CONTRIBUTING guidelines.
Issue
It appears that this commit (https://github.com/danielgindi/Charts/pull/3892/files) added the comparison label.caseInsensitiveCompare(label) to ChartData::getDataSetByLabel.
This will always be true, so statements like chartData.getDataSetByLabel("myLabel", ignorecase: true) will return whatever IChartDataSet is at index 0.
Effected code
internal func getDataSetIndexByLabel(_ label: String, ignorecase: Bool) -> Int
{
// TODO: Return nil instead of -1
if ignorecase
{
return dataSets.firstIndex {
guard let label = $0.label else { return false }
return label.caseInsensitiveCompare(label) == .orderedSame
} ?? -1
}
...
}
Follow-up
I'm happy to submit a pull-request to fix this issue 😺
Charts Environment
Charts version/Branch/Commit Number: 3.4.0
Xcode version: 11.3.1
Swift version: 5.0
Platform(s) running Charts: iOS
macOS version running Xcode: 10.15.2
Metadata
Metadata
Assignees
Labels
No labels