Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Tooltip: xychart tooltip content appears beyond bounds. #1902

Open
Artttdez opened this issue Feb 4, 2025 · 0 comments
Open

Tooltip: xychart tooltip content appears beyond bounds. #1902

Artttdez opened this issue Feb 4, 2025 · 0 comments

Comments

@Artttdez
Copy link

Artttdez commented Feb 4, 2025

To follow this code, the tooltip position is calculated based on one of four sectors relative to the cursor click/hover point (top-left, top-right, bottom-left, bottom-right).

Let's consider the following scenario: @visx/xychart is positioned in the center of the viewport with small margins around it. The tooltip, which is used to describe a point, has a long text (shorter than the width of the viewport) and is displayed when the cursor hovers over a specific point. The cursor click occurs slightly to the right of the center of @visx/xychart.

In this scenario, the tooltip's content is displayed in the top-left corner of the screen, but it extends beyond the viewport due to its width. Is it possible to adjust the positioning of the tooltip so that it "rests" on the edge of the viewport without extending beyond it?

Image
@Artttdez Artttdez changed the title Tooltip: tooltip content appears beyond bounds. Tooltip: xychart tooltip content appears beyond bounds. Feb 4, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant