Flutter Pie Charts

Flutter Pie Charts

Pie Chart Cirrus CI - Base Branch Build Status GitHub stars Twitter Follow GitHub last commit Website shields.ioOpen Source Love

This Flutter package provides a Pie Chart Widget with cool animation.

Live Demo: https://apgapg.github.io/pie_chart/

💻 Installation

In the dependencies: section of your pubspec.yaml, add the following line:

Version

dependencies:
  pie_chart: <latest version>

❔ Usage

Import this class

import 'package:pie_chart/pie_chart.dart';

Usage is simple. Pie Chart is a widget and it just need a Map<String,double> as its data input.

Flutter Pie Chart

Map<String, double> dataMap = new Map();
dataMap.putIfAbsent("Flutter", () => 5);
dataMap.putIfAbsent("React", () => 3);
dataMap.putIfAbsent("Xamarin", () => 2);
dataMap.putIfAbsent("Ionic", () => 2);

– Simple Implementation

PieChart(dataMap: dataMap) 

– Full Implementation

PieChart(
        dataMap: dataMap,
        animationDuration: Duration(milliseconds: 800),
        chartLegendSpacing: 32.0,
        chartRadius: MediaQuery.of(context).size.width / 2.7,
        showChartValuesInPercentage: true,
        showChartValues: true,
        showChartValuesOutside: false,
        chartValueBackgroundColor: Colors.grey[200],
        colorList: colorList,
        showLegends: true,
        legendPosition: LegendPosition.right,
        decimalPlaces: 1,
        showChartValueLabel: true,
        initialAngle: 0,
        chartValueStyle: defaultChartValueStyle.copyWith(
          color: Colors.blueGrey[900].withOpacity(0.9),
        ),
        chartType: ChartType.disc,
    )

Change legend position with ‘legendPosition’

Flutter Pie Chart Flutter Pie Chart Flutter Pie Chart Flutter Pie Chart

Change Chart shape to ring

chartType: ChartType.ring,

Flutter Pie Chart

chartType: ChartType.ring,
showChartValuesOutside: true,

Flutter Pie Chart

⭐ My Flutter Packages

  • json_table GitHub stars Create Flutter Json Table from json map directly.
  • avatar_glow GitHub stars Flutter Avatar Glow Widget with glowing animation.
  • search_widget GitHub stars Flutter Search Widget for selecting an option from list.
  • animating_location_pin GitHub stars Flutter Animating Location Pin Widget providing Animating Location Pin Widget which can be used while fetching device location.

⭐ My Flutter Apps

👍 Contribution

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -m ‘Add some feature’)
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Source Code

Please Visit [Flutter Pie Charts]() Source Code at GitHub