Flutter fl_chart - How can we avoid the overlap of the ordinate?

Viewed 32

i have a chart and sometimes, the ordonate overlaps the min or/and the max value enter image description here

Can this be avoided?

Thx

1 Answers

You can avoid this by checking if the value is the same as the max or min Y value using the "meta" parameter in your "getTitlesWidget" function.

Widget getTitlesWidget(double value, TitleMeta meta) {
    if (value == meta.max) {
      return const Text('');
    } else if (value == meta.min) {
      return const Text('');
    }
    return Text('$value');
}
Related