Plot.barY(data, Plot.groupX({y: "sum" }, {
y:"value",
x: d => d.time.getMonth()
})).plot({
marginLeft: 100,
facet: {
data,
y: d => d.time.getFullYear()
},
marks: [ Plot.frame({ stroke: "#aaa" }) ],
x: { tickFormat: Plot.formatMonth(), grid: true }
})