Time Series Customization


    Let's explore more options by SlickReportView.
    ``__time_series__`` special column name
    And
    ``plot_total`` chart setting
    
class TimeSeriesCustomization(SlickReportView):
    
    report_model = SalesLineTransaction
    date_field = 'transaction_date'
    group_by = 'product'
    columns = ['name',
               '__time_series__',
               # __time_series__ is special column name used to control the placing of the time series columns inside your columns.
               # Default would be appended to the end of the columns.
               SlickReportField.create(Sum, 'value', name='value__sum', verbose_name=_('Grand Sum')),
               ]

    time_series_pattern = 'monthly'
    time_series_columns = [
        SlickReportField.create(Sum, 'value', name='value__sum', verbose_name=_('Sum per month'))
    ]

    chart_settings = [
        {'type': 'bar',
         'data_source': ['value__sum'],
         'title_source': ['name'],
         'title': 'Total quantities per month',
         'plot_total': True  # Plot Totals !
         },
        {'type': 'bar',
         'data_source': ['value__sum'],
         'title_source': ['name'],
         'title': 'Quantities per product per month'
         }
    ]

                

Live Example

Filters

Results

Name Sum per month 2022/01/01 - 2022/02/01 Sum per month 2022/02/01 - 2022/03/01 Sum per month 2022/03/01 - 2022/04/01 Sum per month 2022/04/01 - 2022/05/01 Sum per month 2022/05/01 - 2022/06/01 Sum per month 2022/06/01 - 2022/07/01 Sum per month 2022/07/01 - 2022/08/01 Sum per month 2022/08/01 - 2022/09/01 Sum per month 2022/09/01 - 2022/10/01 Sum per month 2022/10/01 - 2022/11/01 Sum per month 2022/11/01 - 2022/12/01 Sum per month 2022/12/01 - 2023/01/01 Grand Sum