Plot.plot({
marginLeft: 90,
color: { scheme: "BrBG", legend: true },
x: { percent: true },
marks: [
Plot.barX(
coopActives2022,
Plot.groupY(
{ x: "sum" },
{
fill: "Secteur",
y: "Période",
sort: { y: "x", reverse: true, color: "width" },
offset: "normalize"
}
)
),
]
})