Public
Edited
Nov 2, 2023
Insert cell
Insert cell
Insert cell
Insert cell
plot = {
return Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.lineY(ibm.data, {x: "Date", y: "Close", stroke: d => ibm.data.includes(selectedValue) ? "red": "black"}),
Plot.lineY(goog.data, {x: "Date", y: "Close", stroke: d => goog.data.includes(selectedValue) ? "red": "black"}),

Plot.lineY(ibm.data, Plot.pointer({x: "Date", y: "Close", strokeWidth: 10, stroke: "red"})),
Plot.lineY(goog.data, Plot.pointer({x: "Date", y: "Close", strokeWidth: 10, stroke: "red"})),
]
});
}
Insert cell
mutable selectedValue = {}
Insert cell
{
plot.addEventListener("input", (event) => {
mutable selectedValue = plot.value;
});
}

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