set method

Calculates the minimum and maximum x values as well as the range between them.

@param chart @param dataSet

Implementation

void set(BarLineScatterCandleBubbleDataProvider chart,
    IBarLineScatterCandleBubbleDataSet dataSet) {
  double phaseX = math.max(0.0, math.min(1.0, _animator!.getPhaseX()));

  double low = chart.getLowestVisibleX();
  double high = chart.getHighestVisibleX();
  Entry? entryFrom =
      dataSet.getEntryForXValue1(low, double.nan, Rounding.down);
  Entry? entryTo = dataSet.getEntryForXValue1(high, double.nan, Rounding.up);

  _min = entryFrom == null ? 0 : dataSet.getEntryIndex2(entryFrom);
  _max = entryTo == null ? 0 : dataSet.getEntryIndex2(entryTo);

  if (_min! > _max!) {
    var t = _min;
    _min = _max;
    _max = t;
  }

  _range = ((_max! - _min!) * phaseX).toInt();
}