vis2 = Plot.plot({
style: { fontSize: 13 },
width: width > 650 ? 650 : 350,
y: {
label: "Розподіл судових рішень\nза статтю опікунів",
labelArrow: null,
tickFormat: (d) => d * 100 + "%"
},
height: 400,
x: { nice: true },
color: {
domain: ["Жінки", "Чоловіки"],
range: ["#C3B1E1", "#7F8C8D"]
},
marginTop: 40,
marks: [
Plot.areaY(
data.filter((d) => d.sex != "none"),
Plot.windowY(
Plot.binX(
{ y: "count" },
{
x: (d) => d.date,
k: 3,
fill: (d) => (d.sex == "0" ? "Жінки" : "Чоловіки"),
interval: "month",
offset: "normalize"
}
)
)
),
Plot.text(["ЖІНКИ"], {
frameAnchor: "middle",
dx: width > 650 ? -50 : -30,
dy: -50,
fontWeight: 700,
fill: "#fff",
fontSize: 15
}),
Plot.text(["ЧОЛОВІКИ"], {
frameAnchor: "middle",
dx: width > 650 ? 100 : 50,
dy: 0,
fontWeight: 700,
fill: "#fff",
fontSize: 15
})
]
})