Hi community,
Today I was trying to make plotly bar chart with use_container_width=True so that my figure automatically maintains the width as of the container.
But the “View Fullscreen” option was not coming.
Earlier also I have faced the same issue.
I even have a scrollbar to move towards the right side of the graph but the fullscreen option was not visible.
Instead of giving manual width to the graphs, what else we can do go get the fullscreen view visible?
with stylable_container(key=f"barplot_2",
css_styles="""
{
display: flex;
background :white;
color : grey;
border-radius: 5px;
white-space: pre-wrap;
padding: 0px 10px 18px 10px;
text-align:center;
justify-content: center;
overflow-wrap:break-word;
overflow:auto;
border:1px solid #D3D3D3;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
transition: background 0.5s ease-in;
}"""):
fig = go.Figure()
fig.add_trace(go.Bar(
y=uniq_rows["user_name"],
x=uniq_rows[st.session_state.button_clicked],
text=uniq_rows[st.session_state.button_clicked],
orientation='h',
marker=dict(
color='#593ec7',line = dict(color='#3f2b8c', width=1)
)
))
fig.update_layout(margin=dict(l=10, r=10, t=10, b=10),
height=900,
paper_bgcolor='white',
plot_bgcolor='white')
fig.update_traces(textangle=90)
st.plotly_chart(fig,use_container_width=True)