sizeValueMapper property

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 Container(
       child: 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, const Color.fromRGBO(0, 0, 255, 1)),
   BubbleColors(74, 6.5, 1.241, const Color.fromRGBO(255, 0, 0, 1)),
   BubbleColors(90.4, 6.0, 0.238, const Color.fromRGBO(255, 100, 102, 1)),
   BubbleColors(99.4, 2.2, 0.197, const Color.fromRGBO(122, 100, 255, 1)),
];
class BubbleColors {
 BubbleColors(this.year, this.growth,[this.bubbleSize, this.sizeValueMapper]);
 final num year;
 final num growth;
 final num bubbleSize;
 final Color pointColorMapper;
}

Implementation

final ChartIndexedValueMapper<num>? sizeValueMapper;