AspectRatio(
aspectRatio: 16 / 9,
child: DChartBarO(
layoutMargin: LayoutMargin(40, 10, 10, 10),
barLabelValue: (group, data, index) {
return NumberFormat.compactCurrency(
decimalDigits: 0,
symbol: '\$',
).format(data.measure);
},
configRenderBar: ConfigRenderBar(
showBarLabel: true,
barLabelDecorator: BarLabelDecorator(
barLabelPosition: BarLabelPosition.inside,
insideLabelStyle: const LabelStyle(
fontSize: 8,
color: Colors.white,
),
),
barGroupInnerPaddingPx: 0,
radius: 4,
),
domainAxis: const DomainAxis(
showLine: false,
tickLength: 0,
gapAxisToLabel: 12,
labelStyle: LabelStyle(
fontSize: 10,
color: Colors.black54,
),
),
measureAxis: MeasureAxis(
tickLength: 0,
gapAxisToLabel: 8,
tickLabelFormatter: (measure) {
return NumberFormat.compactCurrency(
decimalDigits: 0,
symbol: '\$',
).format(measure);
},
numericTickProvider: const NumericTickProvider(
desiredMinTickCount: 6,
desiredMaxTickCount: 10,
),
labelStyle: const LabelStyle(
fontSize: 10,
color: Colors.black54,
),
),
groupList: [
OrdinalGroup(
id: '1',
data: series1,
color: Colors.lightBlue,
),
OrdinalGroup(
id: '2',
data: series2,
color: Colors.deepPurple,
),
],
),
),