How can I create a real-time candlestick bar chart using the lightweight_charts library by TradingView?

I have created a candlestick bar chart which is being displayed on my streamlit application using the following code which I found on the forum here. This code snippet was posted by @dataprofessor, thank you for sharing the same.

import pandas as pd
from lightweight_charts.widgets import StreamlitChart

chart = StreamlitChart(width=900, height=600)

df = pd.read_csv(‘ohlcv.csv’)
chart.set(df)

chart.load()

I would like to convert this static chart into one that prints live, candle by candle with an interval time which can be set by the user. I have tried multiple different way but none of them are working. I would greatly appreciate if someone can help me with achieving this. There is a method in the lightweight_charts library called “chart.update()” which can be used to do this, but that method does not seem to be working on the streamlit application.