Skip to content

Instantly share code, notes, and snippets.

@nikkisharma536
Created June 11, 2020 09:36
Show Gist options
  • Save nikkisharma536/a4fa4a9b005f86dbfb1b297f94871017 to your computer and use it in GitHub Desktop.
Save nikkisharma536/a4fa4a9b005f86dbfb1b297f94871017 to your computer and use it in GitHub Desktop.
Streamlit altair / line charts
## linechart
st.subheader('Comparision of infection growth')
total_cases_graph =alt.Chart(subset_data).transform_filter(
alt.datum.total_cases > 0
).mark_line().encode(
x=alt.X('date', type='nominal', title='Date'),
y=alt.Y('sum(total_cases):Q', title='Confirmed cases'),
color='Country',
tooltip = 'sum(total_cases)',
).properties(
width=1500,
height=600
).configure_axis(
labelFontSize=17,
titleFontSize=20
)
st.altair_chart(total_cases_graph)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment