| import altair as alt from vega_datasets import data import streamlit as st source = data.wheat() bar = alt.Chart(source).mark_bar().encode( x='year:O', y='wheat:Q' ) line = alt.Chart(source).mark_line(color='red').transform_window( # The field to average rolling_mean='mean(wheat)', # The number of values before and after the current value to include. frame=[-9, 0] ).encode( x='year:O', y='rolling_mean:Q' ) a= (bar + line).properties(width=600) st.altair_chart(a, use_container_width=True) |
다음검색