Plot.plot({
width: 928,
x: {
label: "Population (millions) →"
},
y: {
label: "↑ Proportion living on less than $30 per day (%)",
transform: d => d * 100,
grid: true
},
marks: [
Plot.rectY(povcalnet, Plot.stackX({
filter: d => ["N", "A"].includes(d.CoverageType),
x: "ReqYearPopulation",
order: "HeadCount",
reverse: true,
y2: "HeadCount",
title: d => `${d.CountryName}\n${(d.HeadCount * 100).toFixed(1)}%`,
insetLeft: 0.2,
insetRight: 0.2
})),
Plot.ruleY([0])
]
})