initialChartData method

Future<List<ChartData>> initialChartData(
  1. Map<String, dynamic> dataObj
)

Implementation

Future<List<ChartData>> initialChartData(Map<String, dynamic> dataObj) async {
  List<ChartData> data = [];
  (dataObj['totals'] as List).forEach((e) {
    (e as Map).forEach((k, v) {
      data.add(ChartData(k, double.parse(v['total_amount'].toString())));
    });
  });
  return data;
}