|
@@ -217,7 +217,7 @@ open class ChartDataSet: ChartBaseDataSet
|
|
|
rounding: ChartDataSetRounding) -> Int
|
|
|
{
|
|
|
var closest = partitioningIndex { $0.x >= xValue }
|
|
|
- guard closest < endIndex else { return rounding == .closest ? (endIndex-1) : -1 }
|
|
|
+ guard closest < endIndex else { return index(before: endIndex) }
|
|
|
|
|
|
var closestXValue = self[closest].x
|
|
|
|