Pie Chart This Flutter package provides a Pie Chart Widget with cool animation.
In the dependencies:
section of your pubspec.yaml
, add the following line:
dependencies:
pie_chart: <latest version>
import 'package:pie_chart/pie_chart.dart';
Map<String, double> dataMap = {
"Flutter": 5,
"React": 3,
"Xamarin": 2,
"Ionic": 2,
};
PieChart(dataMap: dataMap)
PieChart(
dataMap: dataMap,
animationDuration: Duration(milliseconds: 800),
chartLegendSpacing: 32,
chartRadius: MediaQuery.of(context).size.width / 3.2,
colorList: colorList,
initialAngle: 0,
chartType: ChartType.ring,
ringStrokeWidth: 32,
centerText: "HYBRID",
legendOptions: LegendOptions(
showLegendsInRow: false,
legendPosition: LegendPosition.right,
showLegends: true,
legendShape: _BoxShape.circle,
legendTextStyle: TextStyle(
fontWeight: FontWeight.bold,
),
),
chartValuesOptions: ChartValuesOptions(
showChartValueBackground: true,
showChartValues: true,
showChartValuesInPercentage: false,
showChartValuesOutside: false,
),
)
chartType: ChartType.ring,
chartType: ChartType.ring,
showChartValuesOutside: true,
Author: apgapg
Demo: https://apgapg.github.io/pie_chart/#/
Source Code: https://github.com/apgapg/pie_chart
#flutter #dart #mobile-apps