What's the best graphic tool for Django


I can retreive some measures from my database.
Actually, I am retrieving temperature for Y axe and date/time for the X axe.
I found tree tools:

  • Matplotlib
  • Bokeh
  • Seaborn

Which one would you recommend me with Django? (and easy to print the chart in my templates)

I looked some example with Matplotlib and I will first try with it. But apparently Matplotlib generates graphic into images. Does Bokeh and Seaborn does the same?

I am used to work with Chartjs which build the charts with JavaScript. The big avantage that I like, with my mouse I can follow the lines and read the information by time. That the reason why, I do not like a lot the image process of Matplotlib, even if I am sure that Matplolit is a great tool. Also, I would like to use python library as much as possible, that the reason why I am not really interrested to use Chartjs for my Gjango version of my app.

Would you have some tutorial with Matplotlib for Gjango?
Would you have another tips & hints for Bokeh and Seaborn?

You suggestion, will help to make a good chose before starting. I do not need an advanced solution. Here is how are my chart done with PHP and Javascript. It’s simple :slight_smile:

Thanks and have a nice day

Actually, when we’re presenting graphical information on a page, we use either chartjs or D3js. We don’t find it necessary to create the images on the server and then send those images.

(Well, technically, I do have an exception for that - I have one specific case where I create images on the server, but that’s because I’m creating a pdf on the server and the images get included in it.)

Dear @KenWhitesell
Thank to coming back to questions :). It’s nice from you

We don’t find it necessary to create the images on the server and then send those images.

I was a bit suprised and I am not favorable to develop a script to show an image and another image each time the visitor refresh the page, as the measures are updated each 15 seconds by sensors. I have up to 20 sensors, so creating images seems to be hard to manage.

As I do not know Matplotlib, Bokeh and Seaborn, I will investigate a bit more in order to see if there is a suitable solution (whithout generating image) otherwise, I am going to use Chartsjs as well.

Thanks a lot

But the key concept here is that you (the server) are not creating the image. You’re delegating that responsibility to the JavaScript running in the user’s browser. So not only are you reducing overall network traffic, you’re also minimizing the CPU utilization of the server. And since the JavaScript library is (typically) a separate file, it’s going to be cached by the browser and so not need to be resent even on a page refresh.

All the server is responsible for is sending the updated data.

I’m a little confused by the statement:

Something needs to create the image. It’s either going to be done on the server (using something like Matplotlib) or it’s going to be done in the browser (Chart.js).
Those are your two options, I’m not sure I understand what you’re thinking your third choice might be.

Yes, it make sens, I am agree.

I’m a little confused by the statement

As I have no experience with those libraries, I was wondering if there would have another solution. But as Python is program running on the server, and not on the client browser, I do not know what they can do better than Chartjs