Plot.plot({
width: 400,
height: 600,
marginTop: 50,
y: {
grid: true,
ticks: d3.range(0, 101, 10),
tickFormat: (d) => (d === 0 ? `${d}` : `${d}%`),
label: "{{Y Label Here}}",
},
x: {
label: "{{X Label Here}}",
},
color: {
range: ["purple", "#ddd"],
legend: true,
domain: ["% Current", "% Target"]
},
marks: [
Plot.barY(hardcodedData, {
y: "percent_current",
x: "bar",
fill: "#ddd",
insetLeft: 2,
insetRight: 2,
tip: true
}),
Plot.barY(hardcodedData, {
y: "percent_target",
x: "bar",
fill: "purple",
insetLeft: 15,
insetRight: 15
}),
]
})