Skip to main content

barLabelValue

String Function(Group, Data, int?)?

  • Displays measure value
barLabelValue: (group, ordinalData, index) {
return ordinalData.measure.round().toString();
},

Sample 1

  • Displays measure value and domain
barLabelValue: (group, ordinalData, index) {
String domain = ordinalData.domain;
String measure = ordinalData.measure.round().toString();
return '$domain: $measure kg';
},

Sample 2

  • Appears depending on conditions
barLabelValue: (group, ordinalData, index) {
if (ordinalData.measure < 6) return '';
String measure = ordinalData.measure.round().toString();
return '$measure kg';
},

Sample 3