/*
 * @Author: WuXiangNan
 * @Date: 2021-04-30 11:50:01
 * @LastEditors  : WuWei
 * @LastEditTime : 2021-09-28 15:25:48
 * @FilePath: /wisdom-huiguanjia-app/business_package/lib/src/components/pie_charts.dart
 * @Description:
 */

// import 'package:business_package/src/models/serve_data/source.dart';
// import 'package:flutter/material.dart';
// import 'package:charts_flutter/flutter.dart' as charts;

// class PieCharts extends StatelessWidget {
//   const PieCharts(this.source, {Key? key}) : super(key: key);
//   final Source? source;

//   @override
//   Widget build(BuildContext context) {
//     return Container(height: 50, child: _pie(source!));
//   }

//   Widget _pie(Source source) {
//     var data = [
//       PieData(0, source.hfwEventsCount,
//           charts.ColorUtil.fromDartColor(Color(0xFF2D8CF0))),
//       PieData(1, source.adminEventsCount,
//           charts.ColorUtil.fromDartColor(Color(0xFF54E2EB))),
//       PieData(2, source.hgjEventsCount,
//           charts.ColorUtil.fromDartColor(Color(0xFFFFE13D))),
//       PieData(3, source.centreEventsCount,
//           charts.ColorUtil.fromDartColor(Color(0xFFFF583D))),
//     ];

//     var seriesList = [
//       charts.Series<PieData, int>(
//         id: 'data',
//         domainFn: (PieData data, _) => data.year,
//         measureFn: (PieData data, _) => data.data,
//         colorFn: (PieData data, _) => data.color,
//         data: data,
//       )
//     ];

//     return charts.PieChart(seriesList,
//         animate: true,
//         defaultRenderer:
//             new charts.ArcRendererConfig(arcWidth: 30, arcRendererDecorators: [
//           // new charts.ArcLabelDecorator(
//           //     labelPosition: charts.ArcLabelPosition.outside)
//         ]));
//   }
// }

// class PieData {
//   final int year;
//   final int? data;
//   final charts.Color color;
//   PieData(this.year, this.data, this.color);
// }
