StreamlitDuplicateElementId: There are multiple plotly_chart
elements with the same auto-generated ID. When this element is created, it is assigned an internal ID based on the element type and provided parameters. Multiple elements with the same type and parameters will cause this error.
To fix this error, please pass a unique key
argument to the plotly_chart
element.
Tried to change few options - no changes but this warning disappears when i select something and does not matter which chart.
Im using latest streamlit ( installed today ) just dont know what version was few months ago as i didnt had this issue.
Exact code bellow.
def driver():
df = filtered_df
dlist = df['Driver'].unique().tolist()
vairuotojai = st.multiselect("Select Driver RPM", dlist)
st.header("You selected: {}".format(", ".join(vairuotojai)))
dfs = {Driver: df[df['Driver'] == Driver] for Driver in vairuotojai}
fig = go.Figure()
for Driver, df in dfs.items():
fig = fig.add_trace(go.Scatter(x=df["PuDate"], y=df["RPM"], name=Driver))
st.plotly_chart(fig, use_container_width=True)
driver()
def driverrate():
df = filtered_df
dlistr = df["Driver"].unique().tolist()
vairuotojai = st.multiselect("Select Driver Rate", dlistr)
st.header("You selected: {}".format(", ".join(vairuotojai)))
dfs = {Driver: df[df["Driver"] == Driver] for Driver in vairuotojai}
fig = go.Figure()
for Driver, df in dfs.items():
fig = fig.add_trace(go.Scatter(x=df["PuDate"], y=df["Rate"], name=Driver))
st.plotly_chart(fig, use_container_width=True)
driverrate()