I just want to know if this is possible with the free resources from Plotly. I am a student and want to build a project where I…
Call an API for JSON data every 6 seconds.
Work that data into a Dataframe that updates with every API response.
Informs a graph that updates each time the new data is received.
Put that stuff into a Django app and deploy it
So far, I have completed steps 1 and 2, and I was able to put 1 API-response-worth of data into a plotly express graph on google colab. Here is a link where my API data is replaced by random numbers, it runs inside a for loop to simulate the intervalic API call, but it creates new graphs instead of updating the original graph: Google Colab
I’m just hoping for some guidance on:
integrating Plotly with Django
creating a graph that updates live while I run my loop calling API data (and how this would work on a live website)
if I can do all this with the free libraries (again, this is a school project).
Haha, I see your angle here and I respect it. I will certainly be branching out to learning Dash, but for now, I’m need this to be be a plotly graph inside a Django app.
If there is one thing I would really love some help on here (just to narrow the scope of this question), it would be this:
How can I do a live-updating graph in plotly that maintains a 1-hour x-axis, using my API response’s streaming data? Any insight on this would be greatly appreciated!
That’s ok! About your specifc question: if you are doing the front-end with Plotly.js, you can use Plotly.extendTraces to add points to your chart without updating it entirely.