AspectRatio(
aspectRatio: 16 / 9,
child: DChartBarO(
layoutMargin: LayoutMargin(40, 10, 10, 10),
configRenderBar: ConfigRenderBar(
showBarLabel: true,
barLabelDecorator: BarLabelDecorator(
barLabelPosition: BarLabelPosition.outside,
outsideLabelStyle: const LabelStyle(
fontSize: 8,
color: Colors.black54,
),
),
barGroupInnerPaddingPx: 8,
radius: 2,
maxBarWidthPx: 10,
),
domainAxis: DomainAxis(
showLine: true,
lineStyle: LineStyle(color: Colors.grey.shade200),
tickLength: 0,
gapAxisToLabel: 12,
labelStyle: const LabelStyle(
fontSize: 10,
color: Colors.black54,
),
),
measureAxis: MeasureAxis(
gapAxisToLabel: 8,
numericTickProvider: const NumericTickProvider(
desiredMinTickCount: 5,
desiredMaxTickCount: 10,
),
useGridLine: true,
gridLineStyle: LineStyle(
color: Colors.grey.shade300,
dashPattern: [4],
),
labelStyle: const LabelStyle(
fontSize: 10,
color: Colors.black54,
),
),
barLabelValue: (group, data, index) {
return '${data.measure}';
},
groupList: [
OrdinalGroup(
id: '1',
data: series1,
color: Colors.lightBlue,
),
OrdinalGroup(
id: '2',
data: series2,
color: Colors.deepPurple,
),
],
),
),