I am trying to build a pie chart like this enter image description here I have tried library but I am unable to achieve this type of chart. Is there any way to build a chart like this in flutter.
Asked
Active
Viewed 43 times
1 Answers
1
You can use the syncfusion_flutter_charts to achieve this feature.and don't forgot change cornerStyle as cornerStyle: CornerStyle.endCurve
sample link: https://flutter.syncfusion.com/#/circular-charts/chart-types/doughnut/rounded-corners
@override
Widget build(BuildContext context) {
return _buildRoundedDoughnutChart();
}
/// Returns the circular charts with rounded corner doughnut series.
SfCircularChart _buildRoundedDoughnutChart() {
return SfCircularChart(
legend: Legend(
isVisible: !isCardView, overflowMode: LegendItemOverflowMode.wrap),
title: ChartTitle(text: isCardView ? '' : 'Software development cycle'),
series: _getRoundedDoughnutSeries(),
);
}
/// Returns rounded corner doughunut series.
List<DoughnutSeries<ChartSampleData, String>> _getRoundedDoughnutSeries() {
return <DoughnutSeries<ChartSampleData, String>>[
DoughnutSeries<ChartSampleData, String>(
dataSource: <ChartSampleData>[
ChartSampleData(x: 'Planning', y: 10),
ChartSampleData(x: 'Analysis', y: 10),
ChartSampleData(x: 'Design', y: 10),
ChartSampleData(x: 'Development', y: 10),
ChartSampleData(x: 'Testing & Integration', y: 10),
ChartSampleData(x: 'Maintainance', y: 10)
],
animationDuration: 0,
cornerStyle: CornerStyle.endCurve,
radius: '80%',
innerRadius: '60%',
xValueMapper: (ChartSampleData data, _) => data.x as String,
yValueMapper: (ChartSampleData data, _) => data.y,
),
];
}

Moony-Stary
- 451
- 10
-
is it free to use? – Hasnain Bhatti Jul 20 '23 at 09:40
-
yes, it's free package – Moony-Stary Jul 20 '23 at 10:25