Plot.plot({
width: 1400,
height: 800,
x: {
align: 0,
round: false,
domain: waterfall_data.map((d) => d.month)
},
y: {
grid: true,
nice: true
},
marks: [
Plot.barY(waterfall_data, {
x: "month",
y1: "value_from_2019",
y2: "value_from_2022",
fill: (d) => (d.increaseOrDecrease >= 0 ? "#FF7540" : "#A1B697"),
opacity: 0.2
}),
Plot.arrow(waterfall_data, {
x: "month",
y1: "value_from_2019",
y2: "value_from_2022",
stroke: (d) => (d.increaseOrDecrease >= 0 ? "#FF7540" : "#A1B697"),
strokeWidth: 2.5
})
]
})