How do I implement Excel's data bar function?


It can be implemented on plotly, but how do I implement this on streamlit?

Hi @JeongBeom_Seo, welcome to the community! :wave: :smile:

Have you checked out st.column_config.ProgressColumn - Streamlit Docs ? You can use it as a column within st.dataframe or st.data_editor like so:

import pandas as pd
import streamlit as st

data_df = pd.DataFrame(
    {
        "sales": [200, 550, 1000, 80],
    }
)

st.data_editor(
    data_df,
    column_config={
        "sales": st.column_config.ProgressColumn(
            "Sales volume",
            help="The sales volume in USD",
            format="$%f",
            min_value=0,
            max_value=1000,
        ),
    },
    hide_index=True,
)

Have a look at the Column Configuration API. You can include bar and line charts in columns too, among other cool types!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.