Public
Edited
Apr 23, 2023
1 star
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.areaY(data, Plot.stackY({order: "sum", reverse}, Plot.binX({y: "count"}, {fill: "color", x: "x"})))
]
})
Insert cell
data = [
{x: 1, color: "r"},
{x: 1, color: "b"},
{x: 1, color: "b"},
{x: 2, color: "r"},
{x: 2, color: "b"},
{x: 2, color: "b"},
{x: 3, color: "r"},
{x: 3, color: "b"},
{x: 3, color: "b"}
]
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