To ensure that the chart fits inside its container, you can set the width property of the chart to "container" using Altair. Here’s the modified code:
import altair as alt
from vega_datasets import data
source = data.barley()
b = alt.Chart(source).mark_bar().encode(
x=alt.X('year:O', title=None),
y='yield:Q',
color='variety:N',
column=alt.Column('site:N', title=None,
header=alt.Header(labelColor='blue'))
).properties(width='container')
st.altair_chart(b)