Plot.plot({
color: { legend: true },
y: {
domain: [-30, 30],
label: null,
ticks: 0
},
x: {
label: null,
ticks: 0
},
marks: [
Plot.areaY(data, {
filter: (d) => d.series == 1,
x: "x",
y: "y",
fill: "#56BB89",
tip: true
}),
Plot.areaY(data, {
filter: (d) => d.series == 2,
x: "x",
y: "y",
fill: "#E55C29",
tip: true
}),
Plot.text(data, {
filter: (d) => d.series == 1,
x: "x",
y: "y",
text: "y",
fill: "#56BB89",
dy: -20,
fontFamily: "Tahoma, sans-serif",
fontSize: 25,
fontWeight: 900
}),
Plot.text(data, {
filter: (d) => d.series == 2,
x: "x",
y: "y",
text: "y",
fill: "#E55C29",
dy: 20,
fontFamily: "Tahoma, sans-serif",
fontSize: 25,
fontWeight: 900
}),
Plot.ruleY([0], {stroke: "white", strokeWidth: 5})
]
})