Highlighting no longer works
russell-garmin opened this issue · comments
russell-garmin commented
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:
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)
}
June Lara commented
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)
Porter commented
+1
IvanTulaev commented
Thanks!
It's work for me.
Pierre-Marc Airoldi commented
Closed by #4721