calcMinMaxForEntry method

  1. @protected
void calcMinMaxForEntry(
  1. Entry e,
  2. AxisDependency axis
)

Widens the overall ranges and the ranges of axis to include e.

axis is the y axis the entry's set belongs to. Kotlin's protected calcMinMax(e: Entry, axis) overload.

Implementation

@protected
void calcMinMaxForEntry(Entry e, AxisDependency axis) {
  if (yMax < e.y) yMax = e.y;
  if (yMin > e.y) yMin = e.y;
  if (xMax < e.x) xMax = e.x;
  if (xMin > e.x) xMin = e.x;

  if (axis == AxisDependency.LEFT) {
    if (leftAxisMax < e.y) leftAxisMax = e.y;
    if (leftAxisMin > e.y) leftAxisMin = e.y;
  } else {
    if (rightAxisMax < e.y) rightAxisMax = e.y;
    if (rightAxisMin > e.y) rightAxisMin = e.y;
  }
}