Unlisted
Edited
Jun 28, 2024
Insert cell
Insert cell
chart = Plot.plot({
height: 300,
style: { fontSize: "14px" },
y: { label: null, grid: true },
x: { padding: 0.4, label: null },
marks: [
Plot.barX(ratings, { x: "Votes", y: "Rating", fill: "Rating", inset: 1 }),
Plot.frame({stroke: "silver"})
]
})
Insert cell
ratings = [
{Rating: 0.5, Votes: 0},
{Rating: 1, Votes: 5},
{Rating: 1.5, Votes: 7},
{Rating: 2, Votes: 14},
{Rating: 2.5, Votes: 32},
{Rating: 3, Votes: 67},
{Rating: 3.5, Votes: 70},
{Rating: 4, Votes: 40},
{Rating: 4.5, Votes: 13},
{Rating: 5, Votes: 19},
]
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