I’m making dashboard on streamlit, currently i’m getting all thing one below other but i want to specify that in proper location as we do in power Bi/tableau. I’ll share one code i want at top left side of dashboard just display that in below of my dashboard title. I’ve created function for plots and below code will do dropdown list to show this plot. i want to display that dropdown at top left side below title.
Main Streamlit app
def main():
st.title(‘Valve status’)
# List widget to select the plot
plot_options = ['Pressure vs Time', 'HE-PV Plot']
plot_choice = st.selectbox('Select Plot', plot_options)
# Display the selected plot
if plot_choice == 'Pressure vs Time':
# Plot for Stage 1
fig1 = plot_stage1()
# Plot for Stage 2
fig2 = plot_stage2()
# Display plots side by side using columns layout
col1, col2 = st.columns([2, 3]) # Adjust width ratio as needed
with col1:
st.pyplot(fig1)
with col2:
st.pyplot(fig2)
elif plot_choice == 'HE-PV Plot':
# Plot for Stage 1 HE-PV
fig1 = plot_stage1_he_pv()
# Plot for Stage 2 HE-PV
fig2 = plot_stage2_he_pv()
# Display plots side by side using columns layout
col1, col2 = st.columns([2, 3]) # Adjust width ratio as needed
with col1:
st.pyplot(fig1)
with col2:
st.pyplot(fig2)
if name == “main”:
main()
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.