Skip to content

Commit d219a8b

Browse files
authored
Covering the whole vertical area
1 parent 2f86105 commit d219a8b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

observable-plot/wider-tooltip-areas.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,19 @@ Plot.plot({
3131
The final effect looks like this:
3232

3333
<img width="657" alt="CleanShot 2022-11-21 at 13 55 17@2x" src="https://user-images.githubusercontent.com/9599/203165945-936b527b-6222-4f72-af56-9f072243ecd5.png">
34+
35+
## Covering the whole vertical area
36+
37+
[Fil on Twitter](https://twitter.com/recifs/status/1595002225092620289) suggests this improvement, which extends the hover area for each point on the line to the full height of the chart:
38+
39+
```javascript
40+
Plot.tickX(points, {
41+
x: "date",
42+
title: (d) => d.date.toLocaleString() + " - " + d.users.toLocaleString(),
43+
strokeWidth: 12,
44+
stroke: "white",
45+
opacity: 0.01
46+
})
47+
```
48+
49+

0 commit comments

Comments
 (0)