Skip to main content

b2

alt

import 'package:d_chart/d_chart.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
List<OrdinalData> series1 = [
OrdinalData(domain: 'Jul', measure: 300),
OrdinalData(domain: 'Aug', measure: 600),
OrdinalData(domain: 'Sep', measure: 540),
OrdinalData(domain: 'Oct', measure: 400),
];
List<OrdinalData> series2 = [
OrdinalData(domain: 'Jul', measure: 220),
OrdinalData(domain: 'Aug', measure: 180),
OrdinalData(domain: 'Sep', measure: 240),
OrdinalData(domain: 'Oct', measure: 170),
];
AspectRatio(
aspectRatio: 16 / 9,
child: DChartBarO(
vertical: false,
layoutMargin: LayoutMargin(50, 20, 30, 20),
configRenderBar: ConfigRenderBar(
barGroupInnerPaddingPx: 0,
radius: 30,
),
domainAxis: const DomainAxis(
showLine: false,
tickLength: 0,
gapAxisToLabel: 12,
),
measureAxis: MeasureAxis(
tickLength: 0,
tickLabelFormatter: (measure) {
return NumberFormat.compactCurrency(
symbol: '\$',
decimalDigits: 0,
).format(measure);
},
),
groupList: [
OrdinalGroup(
id: '1',
data: series1,
color: Colors.amber,
),
OrdinalGroup(
id: '2',
data: series2,
color: Colors.deepPurple,
),
],
),
),