Freeze pane functionality

Iโ€™d like to create an app with the functionality to freeze the pane below a plot (similar to Excel).

Here is some sample code:

import pandas as pd
import streamlit as st

pd_df = pd.DataFrame({
    'col_1': [10, 20, 30, 40],
    'idx_1': [1, 2, 3, 4]
})

pd_df.set_index('idx_1', inplace=True)

st.line_chart(pd_df)

st.dataframe(pd_df)

st.dataframe(pd_df)

st.dataframe(pd_df)

st.dataframe(pd_df)

st.dataframe(pd_df)

st.dataframe(pd_df)

Currently when you scroll down on the app, the line chart goes away from your view. Iโ€™d like to be able to always display the line chart, and scroll down through all the dataframes below the line chart (by inserting a bold line below the line chart.)

Hope my question makes sense, Thanks,

ah๏ผŒitโ€™s very similar to my situation. What I want was a fixed header. You have to use st.write("some_html_CSS_stuff",unsafe_allow_html=True) at present. But streamlit team is now planning to add customizable layout as a key feature. See: Are you using HTML in Markdown? Tell us why!
And this is my issue: Is it possible to add a fixed sticky header like sidebar to streamlit?

2 Likes

Hi @Zen,

Currently thatโ€™s not supported in Streamlit, but we are working on Customizable Layout for Streamlit.
In the meantime (as @xzrokeman mentioned) you can hack your way around a solution by using st.markdown.
Please feel free to let us know if you need any additional help!

thanks for replying @kantuni and @xzrokeman , I havenโ€™t been able to get a hack based on st.markdown to work cleanly, I need to spend some more time on this, will get back on this thread, thanks again for replying,