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"))
})
]
})