Group By report with several charts


    We can have multiple Calculation fields, multiple charts and multiple charting engines !!
    
class GroupByViewWith2Charts(SlickReportView):
    
    report_model = SalesLineTransaction
    date_field = 'transaction_date'
    group_by = 'product'
    columns = ['name',
               SlickReportField.create(Sum, 'quantity', name='quantity__sum', verbose_name=_('Quantities Sold')),
               SlickReportField.create(Sum, 'value', name='value__sum', verbose_name=_('Value $')),
               ]

    chart_settings = [
        {'type': 'pie',
         'engine_name': 'highcharts',  # setting the engine per chart
         'data_source': ['quantity__sum'],
         'title_source': ['name'],
         'title': 'Pie Chart (Quantities) Highcharts'
         },
        {'type': 'pie',
         'engine_name': 'chartsjs',  # setting the engine per chart
         'data_source': ['quantity__sum'],
         'title_source': ['name'],
         'title': 'Pie Chart (Quantities) ChartsJs'
         },
        # Default: fall back to the what's set in SLICK_REPORTING_DEFAULT_CHARTS_ENGINE
        {'type': 'bar',
         'data_source': ['value__sum'],
         'title_source': ['name'],
         'title': 'Column Chart (Values)'
         },
    ]

                

Live Example

Filters

Results