updateDataPoints method
void
updateDataPoints(])
Implementation
@override
void updateDataPoints(
List<int>? removedIndexes,
List<int>? addedIndexes,
List<int>? replacedIndexes, [
List<ChartValueMapper<T, num>>? yPaths,
List<List<num>>? chaoticYLists,
List<List<num>>? yLists,
List<ChartValueMapper<T, Object>>? fPaths,
List<List<Object?>>? fLists,
]) {
if (dataSource == null ||
dataSource!.isEmpty ||
xValueMapper == null ||
yValueMapper == null) {
return;
}
if (fPaths == null) {
fPaths = <ChartValueMapper<T, Object>>[];
fLists = <List<Object?>>[];
}
_addPointColorMapper(fPaths, fLists);
_addSortValueMapper(fPaths, fLists);
if (removedIndexes != null) {
_removeDataPoints(
removedIndexes, yPaths, chaoticYLists, yLists, fPaths, fLists);
}
if (addedIndexes != null) {
_addDataPoints(
addedIndexes, yPaths, chaoticYLists, yLists, fPaths, fLists);
}
if (replacedIndexes != null) {
_replaceDataPoints(
replacedIndexes, yPaths, chaoticYLists, yLists, fPaths, fLists);
}
_applyEmptyPointModeIfNeeded(chaoticYValues);
_doSortingIfNeeded(chaoticYValues, yLists);
final DoubleRange xRange = _findMinMaxXRange(xValues);
final DoubleRange yRange = _findMinMaxYRange(chaoticYValues);
_updateAxisRange(
xRange.minimum, xRange.maximum, yRange.minimum, yRange.maximum);
computeNonEmptyYValues();
_populateTrendlineDataSource();
canUpdateOrCreateSegments = true;
markNeedsLayout();
}