easy_pie_chart 1.0.2

SDKflutter
Platformandroidioswindowslinuxmacosweb

The Easy Pie Chart package offers a versatile Flutter widget for interactive and visually appealing pie charts with customization options.

Easy Pie Chart Package

The Easy Pie Chart package provides a versatile pie chart widget for Flutter applications. It offers various customization options to create interactive and visually appealing pie charts.

Features

  • Three Pie Chart Variants:

    • Crust: Only border, no fill.
    • TriCrust: Borders around each pie slice.
    • Fill: Filled pie slices.
  • Interactive Pie Slices:

    • Each pie slice is interactive and responds to user taps.
  • Customization Options:

    • Adjustable gap between pie slices.
    • Control over the border edge style (rounded, squared, etc.).
    • Start angle of the pie chart can be customized.
    • Text or widget display options inside the pie chart.
    • Animations: Clockwise and anti-clockwise animations with adjustable duration.

Getting started

To use this package, add the following line to your pubspec.yaml file:

dependencies:
  easy_pie_chart: ^version

or simply run the command in your terminal at project root directory

flutter pub add easy_pie_chart

Then, import the package in your Dart file:

import 'package:easy_pie_chart/easy_pie_chart.dart';

Usage

Here's a simple example of creating a Easy pie chart:

EasyPieChart(
  children: [
    PieData(value: 30, color: Colors.red),
    PieData(value: 50, color: Colors.blue),
  ],
)

Demo GIF

For more examples, check out the /example folder in this repository.

Properties

NameDescriptionDefault ValueData TypeRequired
childrenList of PieData objects representing each pie slice.-ListYes
showValueDetermines whether the value is shown on each pie slice.trueboolNo
startStarting angle of the pie chart in degrees.-90doubleNo
gapGap between pie chart slices.0.0doubleNo
borderWidthWidth of the border for crust and triCrust pie types.30.0doubleNo
borderEdgeEdge shape of the border for crust pie type.StrokeCap.roundStrokeCapNo
shouldAnimateDetermines if the pie chart animates clockwise during build.trueboolNo
animateDurationDuration of the animation.1500msDuration?No
animateFromEndIf true, animation starts anti-clockwise.falseboolNo
centerTextText to be displayed at the center of the pie chart.nullString?No
styleTextStyle for centerText.nullTextStyle?No
centerStyleTextStyle for the value displayed on each pie slice.nullTextStyle?No
pieTypeEnum defining the pie chart type (crust, triCrust, fill).PieType.crustPieTypeNo
onTapFunction triggered when a pie slice is tapped.nullvoid Function(int)?No
sizeSize of the pie chart.200.0doubleNo

Contribution

Easy Pie Chart is 100% free and open source. We encourage and support an active, healthy community that accepts contributions from the public – including you. There are a couple of ways in which you can contribute.

  • Fix a bug
  • Write and improve some documentation. Documentation is very critical to us. We would appreciate help in adding multiple languages to our docs.
  • If you are a developer, feel free to check out the source and submit pull requests.
  • Dig into CONTRIBUTING.MD, which covers submitting bugs, requesting new features, preparing your code for a pull request, etc.
  • Please don't forget to like, follow, and star our repo!.

Bugs or Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket. Pull request are also welcome.

License

This package is available under the MIT License.