如何在Streamlit中创建分组条形图我已经尝试过st.altair(图表)方法来得到答案,但是它仍然显示了堆叠的条形图而不是分组条形图
发布于 2022-11-15 14:02:22
您应该能够使用用牛尾创建条形图,然后将其传递给Streamlit:
chart = alt.Chart(prediction_table2, title='Simulated (attainable) and predicted yield ').mark_bar(
opacity=1,
).encode(
column = alt.Column('date:O', spacing = 5, header = alt.Header(labelOrient = "bottom")),
x =alt.X('variable', sort = ["Actual_FAO", "Predicted", "Simulated"], axis=None),
y =alt.Y('value:Q'),
color= alt.Color('variable')
).configure_view(stroke='transparent')
st.altair_chart(chart)
https://stackoverflow.com/questions/74442954
复制相似问题