Plot.plot({
title: PaysSelectionne1,
margin: 60,
marks: [
Plot.barY(tableData, {
x: "norm",
y: "certificates",
sort: { x: "y", reverse: true },
fill: d => colorScale(d.certificates)
}),
Plot.ruleY([0]),
Plot.text(tableData, {
x: "norm",
y: "certificates",
text: d => d.certificates.toString(),
dy: -12,
fontSize: 12
})
],
x: {
type: "band",
label:"Source : ISO Survey",
labelAnchor: "right",
labelOffset: 36,
},
y: {
type: "linear",
domain: [0, d3.max(tableData, d => d.certificates)],
ticks: tableData.length,
tickFormat: "d",
},
style: {
fontSize: 12,
},
height: 400,
width: 1000,
});