Help with some streamlit graphics

Good morning, I need help to change the color of some graphics. We are using streamlit to graph it for an inventory replenishment interface where there are two indicators in the dataframe, one for existence and the other for sales.


# Configurar los gráficos de existencias utilizando AreaChartColumn y BarChartColumn
column_config = {
    "Existencias Totales": st.column_config.BarChartColumn(
        "EXISTENCIA",
        help="El comportamiento del inventario en los últimos meses",
        width="medium"
    ),
    "Ventas Mensuales": st.column_config.AreaChartColumn(
        "VENTAS",
        help="Las ventas mensuales en los últimos meses",
        width="medium"
    ),
    "Cantidad a reponer sugerida": st.column_config.NumberColumn("Cantidad a reponer sugerida"),
    "Cantidad a reponer confirmada": st.column_config.NumberColumn("Cantidad a reponer confirmada"),
    
    "¿Reponer?": st.column_config.CheckboxColumn(
        "¿Reponer?",
        help="Selecciona si deseas reponer este producto",
        
    )
}

df_respHist_nuevo = st.data_editor(
                st.session_state['df_reposicionHistorica'],
                column_config=column_config,
                hide_index=True,
                disabled=disabled_columns  # Deshabilitar las columnas especificadas
            )

This is how they currently look, we would like to put a light green color on them.

image

I believe that at this time, there is no direct way to change the color of the charts in Streamlit using st.column_config.AreaChartColumn and st.column_config.BarChartColumn. Have you thought about generating the graphics outside the dataframe with a graphics library?

Those colors are controlled by the theme.primaryColor parameter in .streamlit/config.toml file (check Theming - Streamlit Docs)

1 Like

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