overflowMode property

MapLabelOverflow overflowMode

Trims or removes the data label when it is overflowed from the shape.

Defaults to MapLabelOverflow.visible.

By default, the data labels will render even if it overflows form the shape. Using this property, it is possible to remove or trim the data labels based on the available space in the shape.

This snippet shows how to set the overflowMode for the data labels in SfMaps.

late List<Model> _data;
late MapShapeSource _mapSource;

 void initState() {

   _data = <Model>[
    Model('India', 280, "Low"),
    Model('United States of America', 190, "High"),
    Model('Pakistan', 37, "Low"),

   _mapSource = MapShapeSource.asset(
     shapeDataField: "name",
     dataCount: _data.length,
     primaryValueMapper: (int index) {
       return _data[index].country;
     dataLabelMapper: (int index) {
       return _data[index].country;

 Widget build(BuildContext context) {
   return SfMaps(
     layers: [
         showDataLabels: true,
         source: _mapSource,
                   overflowMode: MapLabelOverflow.hide

class Model {
 const Model(this.country, this.count, this.storage);

 final String country;
 final double count;
 final String storage;


final MapLabelOverflow overflowMode;