You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
partitioningIndex appears to be used incorrectly. $0.x == xValue should be a different closure that runs $0.x >= xValue. Existing match closure should be used for .prefix(while:) only.
The fix:
open override func entriesForXValue(_ xValue: Double) -> [ChartDataEntry]
{
let belongsInSecondPartition: (ChartDataEntry) -> Bool = { $0.x >= xValue }
let i = partitioningIndex(where: belongsInSecondPartition)
guard i < endIndex else { return [] }
let match: (ChartDataEntry) -> Bool = { $0.x == xValue }
return self[i...].prefix(while: match)
}
Think I have a proper fix open for this #4817 which is basically the same as yours with a few extra lines to handle closest values in a more elegant way #4719 (comment)
Tested change from 4.0.0 to 4.0.2.
partitioningIndex appears to be used incorrectly.
$0.x == xValue
should be a different closure that runs$0.x >= xValue
. Existing match closure should be used for .prefix(while:) only.The fix:
https://github.com/danielgindi/Charts/blob/b61fc9b97829ab9b954d01f96e601d52045ef5dc/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift#L200
The text was updated successfully, but these errors were encountered: