Reputation: 83
I have a plotly chart visualized with streamlit, but when I load it on the hosted streamlit service {appname}.streamlit.app
, it applies a black horizontal like at 0 that doesn't show up on local host.
Any idea on how to fix this?
showline = False
doesn't seem to work in the xaxis
or yaxis
update layout method either
[EXPECTED] Local Host Chart (No horizontal black line at 0)
Incorrected chart displaying on the streamlit hosted service
Edit (adding code):
price_data = btc_price()
drawdown_fig = px.line(price_data, x=price_data.Date, y=price_data.Price, title=f'Significant Bitcoin Drawdowns')
drawdown_fig.update_layout(
font=dict(
family="Proxima Nova",
size=12,
color="Black"
),
plot_bgcolor='rgba(0,0,0,0)',
showlegend = False,
xaxis=dict(
title=None,
showgrid=False,
showline=False,
),
yaxis=dict(
title=None,
showgrid=False,
showline=False,
),
)
drawdown_fig.update_traces(line_color='#27B296', line_width=1)
drawdown_fig.add_annotation(x=dt.date(2011, 6, 1),
y=5500,
text="Jun 2011<br>-99%",
showarrow=False,
)
#removed the other annotations here for simplicity / to save space
st.plotly_chart(drawdown_fig)
Upvotes: 6
Views: 2145
Reputation: 5741
Try to modify your yaxis
configuration to add zeroline=False
. I am pretty sure that would remove the horizontal black line at 0 on the hosted streamlit service.
yaxis=dict(
title=None,
showgrid=False,
showline=False,
zeroline=False,
)
Upvotes: 4