Connect frontend + backend

I want to stream tweets and refresh graphs after start button is clicked.
Streaming working perfectly but refreshing not (used intervals). I gather tweets in SQLite database and at the same time quering to this base to refresh graphs. Plots are in the same state. Why it doesn’t work? Is there a way to stream tweets in background and keep refreshing plots based on latest tweets?