Laiq37 / easy_pie_chart

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.
MIT License
3 stars 7 forks source link
android dart eas-pie-chart flutter hacktoberfest hacktoberfest2023 ios open-source package piechart web

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

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:

PieChart(
  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

Name Description Default Value Data Type Required
children List of PieData objects representing each pie slice. - List Yes
showValue Determines whether the value is shown on each pie slice. true bool No
start Starting angle of the pie chart in degrees. -90 double No
gap Gap between pie chart slices. 0.0 double No
borderWidth Width of the border for crust and triCrust pie types. 30.0 double No
borderEdge Edge shape of the border for crust pie type. StrokeCap.round StrokeCap No
shouldAnimate Determines if the pie chart animates clockwise during build. true bool No
animateDuration Duration of the animation. 1500ms Duration? No
animateFromEnd If true, animation starts anti-clockwise. false bool No
centerText Text to be displayed at the center of the pie chart. null String? No
style TextStyle for centerText. null TextStyle? No
centerStyle TextStyle for the value displayed on each pie slice. null TextStyle? No
pieType Enum defining the pie chart type (crust, triCrust, fill). PieType.crust PieType No
onTap Function triggered when a pie slice is tapped. null void Function(int)? No
size Size of the pie chart. 200.0 double No

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.

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.