horizontalTextPadding property

String? horizontalTextPadding
final

To move the plot band text horizontally.

Takes pixel or percentage value. For pixel, input should be like 10px and for percentage  input should be like 10%. If no suffix is specified (10), it will be considered as pixel value.  Percentage value referes to the overall width of the chart. i.e. 100% is equal to the width  of the chart.

This is applicable for both vertical and horizontal axis. Positive value for this property moves the text to right and negative value moves to left.

If verticalTextAlignment or horizontalTextAlignment is specified, text padding will be calculated  from that modified position.

Defaults to null.


Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
          primaryXAxis: NumericAxis(
            plotBands: <PlotBand>[
               PlotBand(
                   horizontalTextPadding:'30%',
               )
             ]
          )
       )
   );
}

Implementation

final String? horizontalTextPadding;