@property
    def charts(self):
        data = self.rows
        chart_data = []
        if data:
            complete_percent = round((data['complete']) * 100 / float(data['total'] or 1))
            incomplete_percent = round((data['incomplete']) * 100 / float(data['total'] or 1))
            complete_formatted = ("%d" if complete_percent.is_integer() else "%.1f") % complete_percent
            incomplete_formatted = ("%d" if incomplete_percent.is_integer() else "%.1f") % incomplete_percent
            chart_data = [
                dict(value=complete_formatted,
                     label=_('Complete %s%%') % complete_formatted,
                     description=_(
                         "%(formatted_percent)s%% (%(raw_number)d) Complete Reports in %(date_range)s"
                     ) % {
                         'formatted_percent': complete_formatted,
                         'raw_number': data['complete'],
                         'date_range': self.datetext()
                     },
                     color='green'),
                dict(value=incomplete_formatted,
                     label=_('Incomplete %s%%') % incomplete_formatted,
                     description=_(
                         "%(formatted_percent)s%% (%(raw_number)d) Incomplete Reports in %(date_range)s"
                     ) % {
                         'formatted_percent': incomplete_formatted,
                         'raw_number': data['incomplete'],
                         'date_range': self.datetext(),
                     },
                     color='purple'),
            ]
        pie_chart = EWSPieChart('', '', chart_data, ['green', 'purple'])
        pie_chart.tooltips = False
        return [pie_chart]
dataset/ETHPy150Open dimagi/commcare-hq/custom/ewsghana/reports/specific_reports/reporting_rates.py/ReportingDetails.charts/original