sizeValueMapper property Null safety

ChartIndexedValueMapper<num>? sizeValueMapper
final

Field in the data source, which is considered as size of the bubble for all the data points.

Note: This is applicable only for bubble series.

Defaults to null.

Widget build(BuildContext context) {
  return SfCartesianChart(
    series: <BubbleSeries<BubbleColors, num>>[
      BubbleSeries<BubbleColors, num>(
        dataSource: chartData,
        sizeValueMapper: (BubbleColors sales, _) => sales.bubbleSize,
      ),
    ],
  );
}
final List<BubbleColors> chartData = <BubbleColors>[
  BubbleColors(92.2, 7.8, 1.347),
  BubbleColors(74, 6.5, 1.241),
  BubbleColors(90.4, 6.0, 0.238),
  BubbleColors(99.4, 2.2, 0.197),
];
class BubbleColors {
  BubbleColors(this.year, this.growth,[this.bubbleSize]);
    final num year;
    final num growth;
    final num bubbleSize;
}

Implementation

final ChartIndexedValueMapper<num>? sizeValueMapper;