Skip to main content

p8

alt

import 'dart:math' as math;
import 'package:d_chart/d_chart.dart';
import 'package:flutter/material.dart';
List<OrdinalData> ordinalDataList = [
OrdinalData(
domain: 'A',
measure: 60,
color: Colors.amber,
),
OrdinalData(
domain: 'B',
measure: 25,
color: Colors.cyan,
),
OrdinalData(
domain: 'C',
measure: 15,
color: Colors.deepPurple,
),
];
AspectRatio(
aspectRatio: 16 / 9,
child: Stack(
children: [
DChartPieO(
data: ordinalDataList,
configRenderPie: const ConfigRenderPie(
strokeWidthPx: 0,
arcWidth: 24,
arcLength: math.pi,
startAngle: -math.pi,
),
),
const Align(
alignment: Alignment(0, -0.3),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Total',
style: TextStyle(
fontSize: 10,
color: Colors.black54,
),
),
Text(
'345',
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 24,
color: Colors.black87,
),
),
],
),
),
],
),
),