Public
Edited
Sep 11, 2023
1 fork
5 stars
Insert cell
Insert cell
Insert cell
Plot.plot({
color: { legend: true },
y: {
domain: [-30, 30],
label: null,
ticks: 0
},
x: {
label: null,
ticks: 0
},
marks: [
//Plot.frame(),
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})
]
})
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more