comparisonChartData method

Future<Map> comparisonChartData(
  1. Map<String, dynamic> dataObj
)

Implementation

Future<Map> comparisonChartData(Map<String, dynamic> dataObj) async {
  int counter = 0;
  final obj = (dataObj['comparison'] as Map).entries;
  obj.forEach((v) {
    counter +=
        int.parse(v.value['total_amount'].toString().replaceAll(".", ""));
    d.add(_ChartData(
        v.key, double.parse(v.value['total_amount'].toString()) / 10));
    d2.add(
        _ChartData(v.key, double.parse(v.value['total_charge'].toString())));
  });
  return {"charges": d2, "total": d, "counter": counter};
}