Skip to main content

b8

alt

import 'package:d_chart/d_chart.dart';
import 'package:flutter/material.dart';
List<OrdinalData> series1 = [
OrdinalData(domain: 'A', measure: 38),
OrdinalData(domain: 'B', measure: 43),
OrdinalData(domain: 'C', measure: 40),
OrdinalData(domain: 'D', measure: 67),
OrdinalData(domain: 'E', measure: 28),
];
List<OrdinalData> series2 = [
OrdinalData(domain: 'A', measure: 30),
OrdinalData(domain: 'B', measure: 60),
OrdinalData(domain: 'C', measure: 40),
OrdinalData(domain: 'D', measure: 50),
OrdinalData(domain: 'E', measure: 30),
];
AspectRatio(
aspectRatio: 16 / 9,
child: DChartBarO(
layoutMargin: LayoutMargin(40, 10, 10, 10),
configRenderBar: ConfigRenderBar(
barGroupInnerPaddingPx: 0,
maxBarWidthPx: 10,
),
domainAxis: DomainAxis(
showLine: true,
lineStyle: LineStyle(color: Colors.grey.shade300),
tickLength: 0,
useGridLine: true,
gridLineStyle: LineStyle(color: Colors.grey.shade300),
gapAxisToLabel: 12,
labelStyle: const LabelStyle(
fontSize: 10,
color: Colors.black54,
),
),
measureAxis: MeasureAxis(
useGridLine: true,
gridLineStyle: LineStyle(color: Colors.grey.shade300),
gapAxisToLabel: 8,
numericTickProvider: const NumericTickProvider(
desiredMinTickCount: 4,
desiredMaxTickCount: 8,
),
tickLength: 0,
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,
),
],
),
),