我必须每 5 秒重新加载一次 Streamlit 图表,以便在 XLSX 报告中可视化新数据。如何做到这一点?
import streamlit as st
import pandas as pd
import os
mainDir = os.path.dirname(__file__)
filePath = os.path.join(mainDir, "sources\\test.xlsx")
df = pd.read_excel(filePath)
option1 = 'Product'
option2 = 'Quantity'
df = df[[option1, option2]].set_index(option1)
st.write('Product Quantity')
st.area_chart(df)