populateDataSource method
void
populateDataSource([
- List<
ChartValueMapper< ? yPaths,T, num> > - List<
List< ? chaoticYLists,num> > - List<
List< ? yLists,num> > - List<
ChartValueMapper< ? fPaths,T, Object> > - List<
List< ? chaoticFLists,Object?> > - List<
List< ? fLists,Object?> >
override
Implementation
@override
void populateDataSource([
List<ChartValueMapper<T, num>>? yPaths,
List<List<num>>? chaoticYLists,
List<List<num>>? yLists,
List<ChartValueMapper<T, Object>>? fPaths,
List<List<Object?>>? chaoticFLists,
List<List<Object?>>? fLists,
]) {
_resetDataHolders();
if (dataSource == null ||
dataSource!.isEmpty ||
super.yValueMapper == null) {
return;
}
final int length = dataSource!.length;
for (int i = 0; i < length; i++) {
final T current = dataSource![i];
final num? yValue = super.yValueMapper!(current, i);
// TODO(Natrayansf): Handle null properly.
if (yValue == null || yValue.isNaN) {
_yRawValues.add(0);
} else {
_yRawValues.add(yValue);
}
}
// Calculate the actual Histogram [X] and [Y] values.
_calculateStandardDeviation(_histogramXValues, _histogramYValues);
_xCount = _histogramXValues.length;
// Invoke custom [_histogramXValueMapper] method.
xValueMapper = _histogramXValueMapper;
super.populateDataSource(
yPaths, chaoticYLists, yLists, fPaths, chaoticFLists, fLists);
populateChartPoints();
}