Reload altair chart when new data is added to df

Hi, I am not sure how to “call chart on that frame”, would u be able to show a code snippet?

this is my current code for st.line_chart for reloading the chart based on new updates of rows.

cpu_chart = st.line_chart(df height=250)

for i in range(100):
    cpu_chart.add_rows(df2)

For altair, a code like this wouldnt work as it will create a new frame every iteration.

numpy as np
import altair as alt 
df = pd.DataFrame(
    np.random.randn(100, 3),
    columns=['a', 'b', 'c'])

c = alt.Chart(df).mark_circle().encode(
    x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])

st.altair_chart(c, use_container_width=True)

for i in range(100):
  
  df = pd.DataFrame(
      np.random.randn(100, 3),
      columns=['a', 'b', 'c'])

  c = alt.Chart(df).mark_circle().encode(
      x='a', y='b', size='c', color='c', tooltip=['a', 'b', 'c'])

  st.altair_chart(c, use_container_width=True)