labelsExtent property

double? labelsExtent
final

Specifies the fixed width for the axis labels. This width represents the space between axis line and axis title.

If an axis label exceeds the specified value, as like maximumLabelWidth feature, axis label will get trimmed and ellipse(...) will be added at the end of the trimmed text.

Additionally, if an axis label width is within the specified value, white space will be added at the beginning for remaining width. This is done to maintain uniform bounds and to eliminate axis label flickering on zooming/panning.

Complete label text will be shown in a tooltip when tapping/clicking over the trimmed axis labels.

Defaults to null.

Widget build(BuildContext context) {
    return Container(
        child: SfCartesianChart(
           primaryXAxis: CategoryAxis(labelsExtent: 70),
           series: [
             BarSeries<ChartData, String>(
               dataSource: <ChartData>[
                 ChartData(x: 'Goldin Finance 117', y: 597),
                 ChartData(x: 'Ping An Finance Center', y: 599),
                 ChartData(x: 'Makkah Clock Royal Tower', y: 601),
                 ChartData(x: 'Shanghai Tower', y: 632),
                 ChartData(x: 'Burj Khalifa', y: 828)
               ],
               xValueMapper: (ChartData sales, _) => sales.x,
               yValueMapper: (ChartData sales, _) => sales.y
             )
           ],
       )
    );
}

Implementation

final double? labelsExtent;