Plot.plot({
marks: [
Plot.rect(
series,
Plot.pointerX({
x: "time",
interval: {
floor: (x) => Math.floor(x) - 0.5,
offset: (x) => x + 1
},
fill: "#eee",
insetTop: -10
})
),
,
Plot.line(series, {
stroke: "series",
x: "time",
y: "value",
marker: true,
curve: "natural"
}),
Plot.arrow(
series,
Plot.pointerX(
Plot.groupX(
{ y1: "min", y2: "max" },
{ x: "time", y: "value", z: "time", inset: 10 }
)
)
)
]
})