Public
Edited
Feb 1
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
printTable(census2000)
Insert cell
vl.markLine()
.data(census2000)
.encode(
vl.x().fieldQ('Age').title('Age Group'),
vl.y().fieldQ('People').title('Population'),
vl.color().fieldN('Sex').title('Sex')
.scale({domain: ['Male', 'Female']}),
vl.detail().fieldN('Year'),
vl.strokeDash().fieldN('Year')
)
.transform(
vl.calculate("datum.Sex === '1' ? 'Male' : 'Female'").as("Sex")
)
.width(800)
.height(600)
.title("U.S. Population Distribution by Age (1900 vs. 2000)")
.render()






Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more