Reputation: 1029
I'm plotting some data in Streamlit and the site looks great on my desktop. However when I view it on my mobile device the right side is cut off. My code:
fig = go.Figure()
fig.add_trace(go.Scatter(x=[time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(t)) for t in times], y=[i for i in range(num_times)], mode='lines+markers'))
st.plotly_chart(fig)
How can I fix this?
Upvotes: 1
Views: 1346
Reputation: 1029
You can force the plot to have the right width on mobile by changing the line
st.plotly_chart(fig)
to
st.plotly_chart(fig, use_container_width=True)
.
Upvotes: 1