Unlisted
Edited
Dec 30, 2022
Insert cell
Insert cell
chartTest1 = FileAttachment("Chart test@1.png").image()
Insert cell
data = [
{Date: new Date("2022-12-01"), Count: 10},
{Date: new Date("2022-12-02"), Count: 1},
{Date: new Date("2022-12-02"), Count: 1},
{Date: new Date("2022-12-03"), Count: 2},
{Date: new Date("2022-12-04"), Count: 3},
{Date: new Date("2022-12-05"), Count: 4},
{Date: new Date("2022-12-06"), Count: 5},
]
Insert cell
Plot.plot({
grid: true,
marks: [
Plot.ruleY([0]),
Plot.rectY(data, {
x: "Date",
y: "Count",
interval: d3.utcDay,
rx: 6,
insetBottom: -3,
clip: "frame"
})
]
})
Insert cell
Insert cell
Plot.plot({
grid: true,
x: {
interval: d3.utcDay
},
marks: [
Plot.ruleY([0]),
Plot.barY(
data,
Plot.groupX(
{ y: "sum" },
{ x: "Date", y: "Count", rx: 6, insetBottom: -3, clip: "frame" }
)
)
]
})
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