{"id":13548988,"url":"https://github.com/apgapg/pie_chart","last_synced_at":"2025-04-04T21:09:14.762Z","repository":{"id":34299311,"uuid":"175806962","full_name":"apgapg/pie_chart","owner":"apgapg","description":"Flutter Pie chart with animation ","archived":false,"fork":false,"pushed_at":"2024-02-06T16:06:27.000Z","size":7855,"stargazers_count":180,"open_issues_count":33,"forks_count":86,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T20:08:11.808Z","etag":null,"topics":["chart","dart","flutter","package","pie"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/pie_chart","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apgapg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["paypal.me/ayushpgupta"]}},"created_at":"2019-03-15T11:23:22.000Z","updated_at":"2025-02-15T18:08:57.000Z","dependencies_parsed_at":"2023-11-14T05:20:56.382Z","dependency_job_id":"99774952-28ed-4654-bb1f-fbbea9e1b204","html_url":"https://github.com/apgapg/pie_chart","commit_stats":{"total_commits":152,"total_committers":22,"mean_commits":6.909090909090909,"dds":"0.22368421052631582","last_synced_commit":"3fd757c0cb1475efdac2bd6daecc2bee79161e3a"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apgapg%2Fpie_chart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apgapg%2Fpie_chart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apgapg%2Fpie_chart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apgapg%2Fpie_chart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apgapg","download_url":"https://codeload.github.com/apgapg/pie_chart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249529,"owners_count":20908212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chart","dart","flutter","package","pie"],"created_at":"2024-08-01T12:01:16.929Z","updated_at":"2025-04-04T21:09:14.726Z","avatar_url":"https://github.com/apgapg.png","language":"Dart","funding_links":["paypal.me/ayushpgupta"],"categories":["Dart","Packages"],"sub_categories":[],"readme":"# Pie Chart ![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/apgapg/pie_chart) [![GitHub stars](https://img.shields.io/github/stars/apgapg/pie_chart.svg?style=social)](https://github.com/apgapg/pie_chart) [![Twitter Follow](https://img.shields.io/twitter/url/https/@ayushpgupta.svg?style=social)](https://twitter.com/ayushpgupta) ![GitHub last commit](https://img.shields.io/github/last-commit/apgapg/pie_chart.svg) [![Website shields.io](https://img.shields.io/website-up-down-green-red/http/shields.io.svg)](https://apgapg.github.io/)[![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/apgapg/pie_chart) ![Discord](https://img.shields.io/discord/942386749940858880)\n\nThis Flutter package provides a Pie Chart Widget with cool animation.\n\nMore discussions on Discord: https://discord.gg/7byeCn7MGF\n\n## 💻 Try LIVE Demo\n\nLive Demo: [https://apgapg.github.io/pie_chart/](https://apgapg.github.io/pie_chart/)\n\n\u003cimg src=\"https://raw.githubusercontent.com/apgapg/pie_chart/master/res/s10.png?raw=true\"  width = \"auto\" alt=\"piechart\"\u003e\n\n## 💻 Installation\nIn the `dependencies:` section of your `pubspec.yaml`, add the following line:\n\n[![Version](https://img.shields.io/pub/v/pie_chart.svg)](https://pub.dartlang.org/packages/pie_chart)\n\n```yaml\ndependencies:\n  pie_chart: \u003clatest version\u003e\n```\n\n## ❔ Usage\n\n### Import this class\n\n```dart\nimport 'package:pie_chart/pie_chart.dart';\n```\n\n#### Usage is simple. Pie Chart is a widget and it just need a Map\u003cString,double\u003e as its data input.\n\n\u003cimg src=\"https://raw.githubusercontent.com/apgapg/pie_chart/master/res/app.gif\"  height = \"400\" alt=\"PieChart\"\u003e\n\n```dart\nMap\u003cString, double\u003e dataMap = {\n    \"Flutter\": 5,\n    \"React\": 3,\n    \"Xamarin\": 2,\n    \"Ionic\": 2,\n  };\n```\n\n### - Simple Implementation\n```dart\nPieChart(dataMap: dataMap) \n```\n\n### - Full Implementation\n```dart\nPieChart(\n      dataMap: dataMap,\n      animationDuration: Duration(milliseconds: 800),\n      chartLegendSpacing: 32,\n      chartRadius: MediaQuery.of(context).size.width / 3.2,\n      colorList: colorList,\n      initialAngleInDegree: 0,\n      chartType: ChartType.ring,\n      ringStrokeWidth: 32,\n      centerText: \"HYBRID\",\n      legendOptions: LegendOptions(\n        showLegendsInRow: false,\n        legendPosition: LegendPosition.right,\n        showLegends: true,\n        legendShape: _BoxShape.circle,\n        legendTextStyle: TextStyle(\n          fontWeight: FontWeight.bold,\n        ),\n      ),\n      chartValuesOptions: ChartValuesOptions(\n        showChartValueBackground: true,\n        showChartValues: true,\n        showChartValuesInPercentage: false,\n        showChartValuesOutside: false,\n        decimalPlaces: 1,\n      ),\n      // gradientList: ---To add gradient colors---\n      // emptyColorGradient: ---Empty Color gradient---\n    )\n```\n\n## ⭐ Features\n\n### Control decimal places 'decimalPlaces'\n\n```dart\nchartValuesOptions: ChartValuesOptions(\n  decimalPlaces: 1,\n),\n```\n\n### Change legend position with 'legendPosition'\n\n\u003cimg src=\"https://raw.githubusercontent.com/apgapg/pie_chart/master/res/s4.png\"  height = \"400\" alt=\"PieChart\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/apgapg/pie_chart/master/res/s5.png\"  height = \"400\" alt=\"PieChart\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/apgapg/pie_chart/master/res/s6.png\"  height = \"400\" alt=\"PieChart\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/apgapg/pie_chart/master/res/s7.png\"  height = \"400\" alt=\"PieChart\"\u003e\n\n### Change Chart shape to ring\n\n```dart\nchartType: ChartType.ring,\n```\n\u003cimg src=\"https://raw.githubusercontent.com/apgapg/pie_chart/master/res/s9.png\"  height = \"400\" alt=\"PieChart\"\u003e\n\n```dart\nchartType: ChartType.ring,\nshowChartValuesOutside: true,\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/apgapg/pie_chart/master/res/s8.png\"  height = \"400\" alt=\"PieChart\"\u003e\n\n### Gradient Colors\n\nPie Chart supports gradient as colors. Just pass `gradientList` instead of `colorList` to add gradient to chart colors.\n\n```dart\nfinal gradientList = \u003cList\u003cColor\u003e\u003e[\n  [\n    Color.fromRGBO(223, 250, 92, 1),\n    Color.fromRGBO(129, 250, 112, 1),\n  ],\n  [\n    Color.fromRGBO(129, 182, 205, 1),\n    Color.fromRGBO(91, 253, 199, 1),\n  ],\n  [\n    Color.fromRGBO(175, 63, 62, 1.0),\n    Color.fromRGBO(254, 154, 92, 1),\n  ]\n];\n\n// Pass gradient to PieChart\ngradientList: gradientList,\nemptyColorGradient: [\n Color(0xff6c5ce7),\n Colors.blue,\n],\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/apgapg/pie_chart/master/res/s11.png\"  height = \"400\" alt=\"PieChart\"\u003e\n\n### Base Chart Color\n\nAdd a base pie-chart color via:\n\n```dart\nbaseChartColor: Colors.grey\n```\n\nFull code:\n\n```dart\nclass HomePage2 extends StatelessWidget {\n  HomePage2({Key? key}) : super(key: key);\n\n  final dataMap = \u003cString, double\u003e{\n    \"Flutter\": 5,\n  };\n\n  final colorList = \u003cColor\u003e[\n    Colors.greenAccent,\n  ];\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: Text(\"Pie Chart 1\"),\n      ),\n      body: Container(\n        padding: EdgeInsets.symmetric(horizontal: 16),\n        child: PieChart(\n          dataMap: dataMap,\n          chartType: ChartType.ring,\n          baseChartColor: Colors.grey[300]!,\n          colorList: colorList,\n        ),\n      ),\n    );\n  }\n}\n```\n\n### Total Value\n\nTo show chart arcs based on your total value, add `totalValue` option.\n\n```dart\nclass HomePage2 extends StatelessWidget {\n  HomePage2({Key? key}) : super(key: key);\n\n  final dataMap = \u003cString, double\u003e{\n    \"Flutter\": 5,\n  };\n\n  final colorList = \u003cColor\u003e[\n    Colors.greenAccent,\n  ];\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(\n        title: Text(\"Pie Chart 1\"),\n      ),\n      body: Container(\n        padding: EdgeInsets.symmetric(horizontal: 16),\n        child: PieChart(\n          dataMap: dataMap,\n          chartType: ChartType.ring,\n          baseChartColor: Colors.grey[50]!.withOpacity(0.15),\n          colorList: colorList,\n          chartValuesOptions: ChartValuesOptions(\n            showChartValuesInPercentage: true,\n          ),\n          totalValue: 20,\n        ),\n      ),\n    );\n  }\n}\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/apgapg/pie_chart/master/res/s12.png\"  height = \"400\" alt=\"PieChart\"\u003e\n\n### Center Widget\n\nCreates a new widget placed at pie chart center\n\n```dart\ncenterWidget: Container(color: Colors.red, child: const Text(\"Center\"))\n```\n\n\u003cimg src=\"https://raw.githubusercontent.com/apgapg/pie_chart/master/res/s13.png\"  height = \"400\" alt=\"PieChart\"\u003e\n\n## ⭐ My Flutter Packages\n- [json_table](https://pub.dartlang.org/packages/json_table)  [![GitHub stars](https://img.shields.io/github/stars/apgapg/json_table.svg?style=social)](https://github.com/apgapg/json_table)  Create Flutter Json Table from json map directly.\n- [avatar_glow](https://pub.dartlang.org/packages/avatar_glow)  [![GitHub stars](https://img.shields.io/github/stars/apgapg/avatar_glow.svg?style=social)](https://github.com/apgapg/avatar_glow)  Flutter Avatar Glow Widget with glowing animation.\n- [search_widget](https://pub.dartlang.org/packages/search_widget)  [![GitHub stars](https://img.shields.io/github/stars/apgapg/search_widget.svg?style=social)](https://github.com/apgapg/search_widget)  Flutter Search Widget for selecting an option from list.\n- [animating_location_pin](https://pub.dev/packages/animating_location_pin)  [![GitHub stars](https://img.shields.io/github/stars/apgapg/animating_location_pin.svg?style=social)](https://github.com/apgapg/animating_location_pin)  Flutter Animating Location Pin Widget providing Animating Location Pin Widget which can be used while fetching device location.\n\n## ⭐ My Flutter Apps\n- [flutter_profile](https://github.com/apgapg/flutter_profile)  [![GitHub stars](https://img.shields.io/github/stars/apgapg/flutter_profile.svg?style=social)](https://github.com/apgapg/flutter_profile)  Showcase My Portfolio: Ayush P Gupta on Playstore.\n- [flutter_sankalan](https://github.com/apgapg/flutter_sankalan)  [![GitHub stars](https://img.shields.io/github/stars/apgapg/flutter_sankalan.svg?style=social)](https://github.com/apgapg/flutter_sankalan)  Flutter App which allows reading/uploading short stories.\n\n## 👍 Contribution\n1. Fork it\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -m 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapgapg%2Fpie_chart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapgapg%2Fpie_chart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapgapg%2Fpie_chart/lists"}