Super simple bar charts for django admin list views visualizing the number of objects based on date_hierarchy using Chart.js.
This package serves as a ready-made drop-in solution with Chart.js included. This way you can super-charge your django admin with date-based bar charts in less than a minute 🙂
Install Django admin list charts from PyPI by using
pip install django-admin-list-charts
'admin_list_charts'entry to Django
ListChartMixinover every admin class where you want to display charts in the admin list view. For example:
... from admin_list_charts.admin import ListChartMixin @admin.register(Foo) class FooAdmin(ListChartMixin, admin.ModelAdmin): date_hierarchy = 'created' ...
This rather pragmatic solution was heavily inspired by the work of Dani Hodovic (see https://findwork.dev/blog/adding-charts-to-django-admin/).