Plot.plot({
ariaLabel: "Weather Chart",
ariaDescription: "Bar chart of daily high temperatures for Denver during April 2022, showing temperatures mostly in the 40s to 60s and all but three days with partially cloudy conditions",
color: {
legend: true,
type: 'categorical',
scheme: 'set2'
},
x: {
label: "April 2022",
labelAnchor: "center"
},
y: {
label: "Max Temperature (F)"
},
marks: [
Plot.rectY(data, {
x: d => new Date(d.datetime),
interval: d3.utcDay,
y: "tempmax",
fill: "conditions",
title: d => `${new Date(d.datetime).toLocaleString("en-US", dateOptions)}: ${d.tempmax} degrees and ${d.conditions.toLowerCase()} conditions.`
})
]
})