getMinimumDistance method
Returns the minimum distance from a touch value (in pixels) to the closest value (in pixels) that is displayed in the chart.
@param closestValues @param pos @param axis @return
Implementation
double getMinimumDistance(
List<Highlight> closestValues, double pos, AxisDependency axis) {
double distance = double.infinity;
for (int i = 0; i < closestValues.length; i++) {
Highlight high = closestValues[i];
if (high.axis == axis) {
double tempDistance = (getHighlightPos(high)! - pos).abs();
if (tempDistance < distance) {
distance = tempDistance;
}
}
}
return distance;
}