Sitemap
Go With Flutter

Flutter Tips & Tricks.

Member-only story

30 Flutter Tips| FT27: Pie Chart and Bar Graph In Flutter

--

Flutter Tips 27 of #30FlutterTips With LakshydeepVikram series which had explored about using pie chart and bar-graph in Flutter.
You can search for #30FlutterTips for more. If you like this series, please don’t forget to share with #30FlutterTips tag.

Press enter or click to view image in full size

FT27: Pie Chart and Bar Graph In Flutter

For Pie chart

Install Package pie_chart:

pie_chart:

Use PieChart widget by importing it:

PieChart(
//data types you want to show
dataMap: const {
"LinkedIn": 700,
"GitHub": 1000,
"Medium": 250,
},

animationDuration: const Duration(milliseconds: 800),
chartLegendSpacing: 32,
//height
chartRadius: MediaQuery.of(context).size.height * 0.25,

initialAngleInDegree: 0,
// Types of chart
chartType: ChartType.ring,

centerText: "Followers",
ringStrokeWidth: 32,
// ways to show values
chartValuesOptions: const ChartValuesOptions(
showChartValueBackground: true,
showChartValues: true,
showChartValuesInPercentage: false…

--

--

Lakshydeep Vikram
Lakshydeep Vikram

Written by Lakshydeep Vikram⁠

Software Developer | Google Dev Library Author | Flutter Enthusiast