getDataBounds method
Get data bounds (to be overridden by subclasses).
This method is a placeholder for subclasses to implement custom bounds calculation logic. The default implementation does nothing.
Parameters:
getValue- Function to extract a value from a data pointcombine- Function to combine two values (e.g., min or max)
Example Implementation
@override
void getDataBounds(
double Function(ChartDataPoint) getValue,
double Function(double, double) combine,
) {
double result = getValue(dataSets.first.dataPoint);
for (final dataSet in dataSets) {
final point = dataSet.dataPoint;
result = combine(result, getValue(point));
}
}
// Store result...
}
Implementation
@protected
void getDataBounds(
double Function(ChartDataPoint) getValue,
double Function(double, double) combine,
) {
// This will be overridden by subclasses
}