fl_chart
fl_chart copied to clipboard
reservedSize auto size
Is possible to this value have auto size?
Same need
Same need
@imaNNeo How is this feature progressing?
For now I solved this by using AutoSizeText widget with auto size groups. Each widgets group (bottom titles group, left titles group, top, right...) use auto size text widgets with appropriate AutoSizeGroup reference. It works great!
https://pub.dev/packages/auto_size_text
bottomTitles: AxisTitles(
sideTitles: SideTitles(
interval: data.interval,
showTitles: true,
reservedSize: 30,
getTitlesWidget: (value, meta) {
final result = 'Some computed value';
return SideTitleWidget(
axisSide: meta.axisSide,
space: 10,
angle: 0.0,
child: AutoSizeText(
result,
group: bottomGroup, //HERE USE UNIQUE AUTO SIZE GROUPS, (LEFT/TOP/BOTTOM/RIGHT) <--
maxFontSize: 11,
minFontSize: 8,
maxLines: 1,
overflow: TextOverflow.clip,
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white.withOpacity(0.55),
fontSize: 11,
fontWeight: FontWeight.w400,
),
),
);
},
),
),
@ninoid Thank you so much.