Public
Edited
Aug 13, 2024
2 forks
1 star
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.areaY(aapl, {
x: "Date",
y: "Close",
className: "my-area-y"
}),
Plot.lineY(aapl, {
x: "Date",
y: "Close",
className: "my-line-y"
})
]
})
Insert cell
Insert cell
aapl = FileAttachment("aapl.csv").csv({typed: true})
Insert cell
// deprecated method

Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.areaY(aapl, {
x: "Date",
y: "Close",
render: (i, s, v, d, c, next) => {
const g = next(i, s, v, d, c);
g.classList.add("my-area-y");
return g;
}
}),
Plot.lineY(aapl, {
x: "Date",
y: "Close",
render: (i, scales, v, d, c, next) => {
const g = next(i, scales, v, d, c);
console.log(scales.x.invert());
g.classList.add("my-line-y");
return g;
}
})
]
})
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