How to customize x-axis/vertical legend values?
jaskiratAtNexG opened this issue ยท 2 comments
jaskiratAtNexG commented
lukaknezic commented
Hey @jaskiratAtNexG
You can use WidgetDecoration
to accomplish this.
Example:
WidgetDecoration(
margin: const EdgeInsets.only(bottom: 24.0),
widgetDecorationBuilder: (context, chartState, itemWidth, verticalMultiplier) {
return Container(
alignment: Alignment.bottomCenter,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: [
'๐',
'๐',
'๐',
'๐',
'๐',
'๐',
'๐',
'๐',
'๐',
].map((value) {
return Container(
width: itemWidth,
child: Container(
alignment: Alignment.bottomCenter,
child: Text(value,
style: Theme.of(context)
.textTheme
.subtitle2!
.copyWith(fontSize: 12, fontWeight: FontWeight.bold)),
),
);
}).toList(),
),
);
},
)
By adding this decoration you can insert any widget you want. Just make sure you set width to same width that is passed in builder function. This will make sure that your widgets are shown appropriatelly.
Use this decoration with GridDecoration
to add it below actual values.
jaskiratAtNexG commented
Hi thanks for the solution.