series property Null safety

dynamic series

Get the current series.

   onDataLabelRender: (DataLabelRenderArgs args) {
     CartesianSeries<dynamic, dynamic> series = args.series;
     //Changed the background color of the data label based on the series type
     if ( == 'Product A') {
       args.color =;
     } else if( == 'Product B'){
       args.color =;

Note: Series type may vary based on the chart type.

  • Cartesian chart: CartesianSeries<dynamic, dynamic> series;
  • Circular chart: CircularSeries<dynamic, dynamic> series;
  • Funnel Chart: FunnelSeries<dynamic, dynamic> series;
  • Pyramid Chart: PyramidSeries<dynamic, dynamic> series;


final dynamic series;