direction property

Axis direction

Arranges the legend items in either horizontal or vertical direction.

Defaults to horizontal, if the position is top, bottom or null. Defaults to vertical, if the position is left or right.

 Widget build(BuildContext context) {
   return SfMaps(
     layers: [
         showLegend: true,
         legendSettings: MapLegendSettings(
             direction: Axis.horizontal
         delegate: MapShapeLayerDelegate(
             shapeFile: "assets/world_map.json",
             shapeDataField: "continent",
             dataCount: bubbleData.length,
             primaryValueMapper: (index) {
               return bubbleData[index].country;

See also:

  • position, to set the position of the legend.


final Axis direction