Chart legend is cut off

Hello all!
I have an app running locally and deployed. When I make a chart:

chart = (
    alt.Chart(tidy_final_df)
        .mark_bar()
        .encode(
            x=alt.X("emissions", type="quantitative", title="g CO2e Emitted / MJ"),
            y=alt.Y("Farm", type="nominal", title="Farm").sort("-x"),
            color=alt.Color("emissions_type", type="nominal", legend=alt.Legend(title=None, orient="right")),
            order=alt.Order("emissions_type", sort="descending"),
        )
    )

st.altair_chart(chart, use_container_width=True)

It accurately makes a chart, but the legend is missing one of the bars (light green):


When I increase the height, the light green bar is included in the legend, but then the x axis title is cut off:

Is there a way to fix this? I’d like to just have the regular plot with the full legend without adjusting the height but I am also fine with just adjusting height if the x axis does not get cut off.
Streamlit version = 1.31.1
Thanks!

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