Search code examples
pythondjangodjango-adminadmindashboard

What would be the most efficient way of creating charts/graphs with data from a Django backend


I built an application using Django and I was wondering what would the most efficient way of creating charts and graphs for my data (for personal viewing). I was thinking of having the charts/graphs in a dashboard with the ability to create and delete records in the database(perhaps in a different tab). Originally I was thinking of having this in the Django admin panel since I already use it a lot for looking at/deleting/creating small data. I researched various custom django admin libraries but a lot of them just seems like a UI improvement. Another small feature that I wanted was to regroup various models in different applications into one listing as opposed to the default layout where the main heading is the various django application and under each is the models for the application.

I have a couple ideas about how to go about doing this:

  1. Create custom django admin template for what I need. This would include graphs/charts but I'm not sure about the regrouping.
  2. Maybe create a front-end application to do the graphs and make the groupings myself. This would communicate to the backend via GET/POST/DELETE requests. I would write something in the backend to transform the data into JSON and return that. This options seems like a lot more work but I feel like it would be more flexible for my needs
  3. Use a library. However, I haven't been able to find one that fits what I'm looking for.

Overall I'm looking for something that looks/performs like a dashboard but has the functionality of the django admin panel where i can create/modify/delete records at will.

Any help and/or recommendations would be appreciated.


Solution

    • From python/serverside perspective there are various ploting librarys such as matplotlib that can generate svg graphics. You could make them interactive by sending new request to the server.

    • If you rather want something on the client side (D3.js) for example:D3.js with Django