textStyle property

TextStyle textStyle
final

Customize the legend title text.

Used to change the text color, size, font family, fontStyle, and font weight for the legend title.

Widget build(BuildContext context) {
   return Container(
       child: SfCartesianChart(
           legend: Legend(
              isVisible: true,
              title: ChartTitle(
                   text: 'Countries',
                   textStyle: TextStyle(
                                color: Colors.red,
                                fontSize: 12,
                                fontStyle: FontStyle.normal,
                                fontWeight: FontWeight.w400,
                                fontFamily: 'Roboto')
           ))
       ));
}

Implementation

final TextStyle textStyle;