Unlisted
Edited
Dec 11, 2023
Insert cell
Insert cell
Plot.plot({
grid: true,
fx: {interval: "day"},
x: {axis: null, padding: 0},
y: {label: null},
color: {legend: true},
marks: [
Plot.barY(data, {fx: "Date", y: "Value", x: "Name", fill: "Name"}),
Plot.ruleY([0])
]
})
Insert cell
data = [
{Date: new Date("1962-01-02"), Value: 0.05, Name: "Foo"},
{Date: new Date("1962-01-03"), Value: 0.04, Name: "Foo"},
{Date: new Date("1962-01-04"), Value: 0.03, Name: "Foo"},
{Date: new Date("1962-01-05"), Value: 0.02, Name: "Foo"},
{Date: new Date("1962-01-06"), Value: 0.01, Name: "Foo"},
{Date: new Date("1962-01-02"), Value: 0.01, Name: "Bar"},
{Date: new Date("1962-01-03"), Value: 0.02, Name: "Bar"},
{Date: new Date("1962-01-04"), Value: 0.03, Name: "Bar"},
{Date: new Date("1962-01-05"), Value: 0.04, Name: "Bar"},
{Date: new Date("1962-01-06"), Value: 0.05, Name: "Bar"}
]
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