According to this answer, I'm suppose to use scale = alt.Scae(domain=[0,1.4])
to scale the axis to my preference. But when I do it, the entire bar chart moves lower, hiding the entire x-axis. Why is that?
This is when I'm doing:
chart_df = alt.Chart(agg_df).mark_bar().encode(
y=alt.Y('rsi_value'
),
x=alt.X('idx', sort='y'),
color='type'
)
st.altair_chart(chart_df)
When I am doing this, I am able to control the max value to 60
.
chart_df = alt.Chart(agg_df).mark_bar().encode(
y=alt.Y('rsi_value', scale=alt.Scale(domain=[0, 60])
),
x=alt.X('ticker_idx', sort='y'),
color='type'
)
st.altair_chart(chart_df)
But when I do this:
chart_df = alt.Chart(agg_df).mark_bar().encode(
y=alt.Y('rsi_value', scale=alt.Scale(domain=[20, 60])
),
x=alt.X('ticker_idx', sort='y'),
color='type'
)
The entire X-axis disappears.
I am just trying to make the bar heights more differentiable...any ideas?