Plot.plot({
y: {
grid: true
},
color: {
domain: [-1, 0, 1],
range: ["#4daf4a", "#999999", "#e41a1c"]
},
marks: [
Plot.ruleX(aapl, {
x: "Date",
y1: "Low",
y2: "High"
}),
Plot.ruleX(aapl, {
x: "Date",
y1: "Open",
y2: "Close",
stroke: d => Math.sign(d.Close - d.Open),
strokeWidth: 4,
strokeLinecap: "round"
})
]
})