D'Chart is a package for compact chart widgets. This package is a remake of the charts_flutter package. The remake chart types include bar, line, pie, donut and gauge. The use of this package is made as concise as possible, but with the best chart display.
- Bar
DChartBar(
data: [
{
'id': 'Bar',
'data': [
{'domain': '2020', 'measure': 3},
{'domain': '2021', 'measure': 4},
{'domain': '2022', 'measure': 6},
{'domain': '2023', 'measure': 0.3},
],
},
],
domainLabelPaddingToAxisLine: 16,
axisLineTick: 2,
axisLinePointTick: 2,
axisLinePointWidth: 10,
axisLineColor: Colors.green,
measureLabelPaddingToAxisLine: 16,
barColor: (barData, index, id) => Colors.green,
showBarValue: true,
),
- Line
DChartLine(
data: [
{
'id': 'Line',
'data': [
{'domain': 0, 'measure': 4.1},
{'domain': 2, 'measure': 4},
{'domain': 3, 'measure': 6},
{'domain': 4, 'measure': 1},
],
},
],
lineColor: (lineData, index, id) => Colors.amber,
),
- Pie & Donut
DChartPie(
data: [
{'domain': 'Flutter', 'measure': 28},
{'domain': 'React Native', 'measure': 27},
{'domain': 'Ionic', 'measure': 20},
{'domain': 'Cordova', 'measure': 15},
],
fillColor: (pieData, index) => Colors.purple,
),
DChartPie(
data: [
{'domain': 'Flutter', 'measure': 28},
{'domain': 'React Native', 'measure': 27},
{'domain': 'Ionic', 'measure': 20},
{'domain': 'Cordova', 'measure': 15},
],
fillColor: (pieData, index) => Colors.purple,
donutWidth: 30,
labelColor: Colors.white,
),
- Gauge
DChartGauge(
data: [
{'domain': 'Off', 'measure': 30},
{'domain': 'Warm', 'measure': 30},
{'domain': 'Hot', 'measure': 30},
],
fillColor: (pieData, index) {
switch (pieData['domain']) {
case 'Off':
return Colors.green;
case 'Warm':
return Colors.orange;
default:
return Colors.red;
}
},
showLabelLine: false,
pieLabel: (pieData, index) {
return "${pieData['domain']}";
},
labelPosition: PieLabelPosition.inside,
labelPadding: 0,
labelColor: Colors.white,
),
Tutorial : All Chart Line Chart From Data Collection
Support me for more feature & packages Donate
Check my app : Visit
Check My Tutorial & Course : Watch