Crop grid lines to range
You can use an area mark as clipping path for grid lines
<Plot>
<GridX
strokeOpacity={1}
strokeDasharray="1,2"
y1={0}
y2={(date) =>
aapl
.map((d) => ({
value: d.Close,
date: d.Date,
diff: Math.abs(d.Date - date)
}))
.sort((a, b) => a.diff - b.diff)[0]
.value} />
<Line data={aapl} x="Date" y="Close" />
<RuleY data={[0]} />
</Plot>