Context
Creating a web app and using Plotly for graphs. I created the date slider but want it to be a to be an area graph rather than a line graph. The main graph is fine, and this will not change. But as more and more lines are added, it adds to the slider and does not make it look pretty. So I want to fix the date slider, below the line graph (main graph) as an area graph but maintain the main graph as a line graph. Have looked in the documentation but have not seen anything to this effect.
code:
plotly_fig = px.line(data_frame=dataframe_cols1,x=dataframe_cols1.index,y=Columns_select1)
# Legend settings
plotly_fig.update_layout(showlegend=True)
plotly_fig.update_layout(margin_autoexpand=True) # prevent size from changing because of legend or anything
plotly_fig.update_traces(mode="lines", hovertemplate=None)
plotly_fig.update_layout(hovermode="x unified")
plotly_fig.update_layout(legend=dict(
orientation = "h",
yanchor="bottom",
y=-.85,
xanchor="right",
x=1.0
))
height = 800
plotly_fig.update_layout(
autosize=False,
width=870,
height=height)
# Date range
plotly_fig.update_xaxes(rangeslider_visible=True,
rangeselector=dict(
buttons=list([
dict(count=1, label="1m", step="month", stepmode="backward"),
dict(count=6, label="6m", step="month", stepmode="backward"),
dict(count=1, label="YTD", step="year", stepmode="todate"),
dict(count=1, label="1y", step="year", stepmode="backward"),
dict(step="all")
])))
st.plotly_chart(plotly_fig,use_container_width=True) # streamlit show graph
Problem
Is this possible?