File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Source/Charts/Data/Implementations/Standard Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ open class ChartDataSet: ChartBaseDataSet
214
214
rounding: ChartDataSetRounding ) -> Int
215
215
{
216
216
var closest = partitioningIndex { $0. x >= xValue }
217
- guard closest < endIndex else { return closest }
217
+ guard closest < endIndex else { return - 1 }
218
218
219
219
let closestXValue = self [ closest] . x
220
220
@@ -237,8 +237,6 @@ open class ChartDataSet: ChartBaseDataSet
237
237
break
238
238
}
239
239
240
- guard closest < endIndex else { return endIndex }
241
-
242
240
// Search by closest to y-value
243
241
if !yValue. isNaN
244
242
{
@@ -250,7 +248,7 @@ open class ChartDataSet: ChartBaseDataSet
250
248
var closestYValue = self [ closest] . y
251
249
var closestYIndex = closest
252
250
253
- while closest < endIndex
251
+ while closest < index ( before : endIndex)
254
252
{
255
253
formIndex ( after: & closest)
256
254
let value = self [ closest]
You can’t perform that action at this time.
0 commit comments