mirror of
https://github.com/aykhans/AzSuicideDataVisualization.git
synced 2025-04-21 18:23:35 +00:00
21 lines
510 B
Python
21 lines
510 B
Python
"""
|
|
Streamgraph
|
|
-----------------
|
|
This example shows the streamgraph from vega-lite examples.
|
|
"""
|
|
# category: area charts
|
|
import altair as alt
|
|
from vega_datasets import data
|
|
|
|
source = data.unemployment_across_industries.url
|
|
|
|
alt.Chart(source).mark_area().encode(
|
|
alt.X('yearmonth(date):T',
|
|
axis=alt.Axis(format='%Y', domain=False, tickSize=0)
|
|
),
|
|
alt.Y('sum(count):Q', stack='center', axis=None),
|
|
alt.Color('series:N',
|
|
scale=alt.Scale(scheme='category20b')
|
|
)
|
|
).interactive()
|