How to draw a graph from a SQL request using Dash?

Hi,

Welcome to the community! :slightly_smiling_face:

You can use dcc.Interval to trigger updates at every n seconds: Live Updates | Dash for Python Documentation | Plotly

Then what you need to do is basically take the code that you wrote, add it to the callback and use the value to update the chart. The fastest approach is to use extendData, as explained in this old post: What is a correct usage of extendData property to achieve adding data to existing graph instead of constantly updating it? - #4 by Emmanuelle

Please let us know if you have more specific questions about this use case.

Hope this helps!