computeNonEmptyYValues method

  1. @override
void computeNonEmptyYValues()
override

Implementation

@override
void computeNonEmptyYValues() {
  nonEmptyYValues.clear();
  if (emptyPointSettings.mode == EmptyPointMode.gap ||
      emptyPointSettings.mode == EmptyPointMode.drop) {
    final List<num> yValuesCopy = <num>[...yValues];
    nonEmptyYValues = yValuesCopy;
    for (int i = 0; i < dataCount; i++) {
      if (i == 0 && yValues[i].isNaN) {
        nonEmptyYValues[i] = 0;
      } else if (yValues[i].isNaN) {
        nonEmptyYValues[i] = nonEmptyYValues[i - 1];
      }
    }
  } else {
    final List<num> yValuesCopy = <num>[...yValues];
    nonEmptyYValues = yValuesCopy;
  }
}