Public
Edited
Mar 27, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Inputs.table(data, {})
Insert cell
Plot.plot({
y: {domain: [0, 200]},
marks: [
Plot.barY(data, {
x: "d",
y1: "forecast_lower",
y2: "forecast_upper",
fill: "#eee"
}),
Plot.dot(data, {x: "d", y: "actual", r: 2}),
Plot.linearRegressionY(data, {x: "d", y: "expected_value", stroke: "steelblue", ci: 0.9}),
Plot.axisX({
ticks: 12,
tickFormat: (
(formatYear, formatMonth) => (x) =>
d3.utcMonth.count(d3.utcYear(x), x) < 1
? `${formatMonth(x)}\n${formatYear(x)}`
: formatMonth(x)
)(d3.utcFormat("%Y"), d3.utcFormat("%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