Tooltip problems (Tooltip covered by colors legend when showing above)

i’m using Plot to shows some numbers distribution, using Tooltip together with colors legend,
plot Tooltip problems / Team Matters | Observable 2024-01-01T16:00:00ZPreformatted text

when the tooltip is showing below it’s looking good

but when sometimes the tooltip is showing above it’s covered,

the temporary workaround is to specify a height, make sure enough height for the tooltip, but want the Tooltip fixed to show above colors legend

1 Like

only when the tooltip is showing below it’s looking good

the temporary workaround is to specify a { height: 300 }, make sure enough height for the tooltip, but want the Tooltip fixed to show above colors legend, or is there an option to make sure Tooltip always shown below the graph?

I guess the tooltip appears as a g element of the SVG image produced by Plot. Thus, you can’t see any portion of the tip that extends outside the space allotted for the SVG.

One solution is to specify enough of a margin so that you can see the tip. It seems to work fine, if you set the margin option margin: 40:

Alternatively, you might modify the CSS style by setting

style: "overflow: visible"

Here’s how that second approach looks:

1 Like

@mcmcclur does the documentation need an update? What I’m seeing is “consider setting the plot’s style to overflow: visible; to prevent the tip from being truncated”—which seems correct.

@fil No, you’re right. I don’t think I ever fiddled with the style option before so I tried

overflow: "visible"

rather than

style: "overflow: visible"
1 Like