0

I try to do a dashboard with streamlit, but I do not succeed to impact the graph with the filter. You can see what i did below :

year = st.sidebar.multiselect(
    "select the year : ",
    options=df2["Year"].unique(),
    default=df2["Year"].unique(),
    )
df_selection = df2.query("Year == @year")


fig = px.bar(df2, x="dpe", y="Percentage", color="signature",title="<b> DPE repartition in function of the year <b>")
fig.update_layout(plot_bgcolor="rgba(0,0,0,0)")

If you have any solution for this problem let me know thanks in advance.

bruce
  • 11
  • 2

1 Answers1

0

You need to use st.plotly_chart() to display your bar graph.

try adding the following after

fig.update_layout(plot_bgcolor="rgba(0,0,0,0)")

st.plotly_chart(fig) this should resolve the issue.

micro5
  • 415
  • 3
  • 6