intermediateSumPredicate property
A boolean value, based on which the data point will be considered as intermediate sum or not.
If this has true value, then that point will be considered as an intermediate sum. Else if it has false, then it will be considered as a normal data point in chart.
This callback will be called for all the data points to check if the data is intermediate sum.
Note: This is applicable only for waterfall chart.
Defaults to null
.
Widget build(BuildContext context) {
return SfCartesianChart(
series: <WaterfallSeries<SalesData, num>>[
WaterfallSeries<SalesData, num>(
dataSource: <SalesData>[
SalesData(2, 24, true),
SalesData(3, 22, false),
SalesData(4, 31, true),
],
xValueMapper: (SalesData sales, _) => sales.x,
yValueMapper: (SalesData sales, _) => sales.y,
intermediateSumPredicate:
(SalesData data, _) => data.isIntermediate,
),
],
);
}
class SalesData {
SalesData(this.x, this.y, this.isIntermediate);
final num x;
final num y;
final bool isIntermediate;
}
Implementation
final ChartValueMapper<T, bool>? intermediateSumPredicate;