You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for an outstanding library that finally solves all of the issues related with charts in React.
My problem is related with tooltip positioning in BarStack chart. In a brief - if the BarStack chart comes as the first child, the tooltip is positioned correctly. However if I place it after some component or just after a div, tooltip position changes unexpectedly.
If you hover the bars, you will see that the tooltip appears down below the bars. If we would extend the preceding div height to e.g. 500px, you will see that the tooltip will even go out of the screen when hovering bars.
However, if you remove the preceding div and keep only the chart, the tooltip position will work just fine.
Question: Looking forward for a tip in such case. How to keep the tooltip in place, even if there's some content with a dynamic height before the chart?
Thank you!
The text was updated successfully, but these errors were encountered:
Hey @wisyr 👋 thanks for checking out visx, glad you're enjoying it so far 🎉 .
Thanks for the codesandbox link, I think this is happening because TooltipInPortal expects top/left to be relative to the container it is rendered in. If nothing is rendered above the chart, that happens to be the same as the event.clientY logic.
I have a PR out (#1018) to make the example's logic more robust, lmk if you have any followup questions! (you should be able to match the updated logic in the PR, don't need to wait for it to merge)
First of all, thank you for an outstanding library that finally solves all of the issues related with charts in React.
My problem is related with tooltip positioning in BarStack chart. In a brief - if the BarStack chart comes as the first child, the tooltip is positioned correctly. However if I place it after some component or just after a div, tooltip position changes unexpectedly.
I have created a demo for you. https://codesandbox.io/s/holy-pine-i5sp2?file=/index.tsx
If you hover the bars, you will see that the tooltip appears down below the bars. If we would extend the preceding div height to e.g. 500px, you will see that the tooltip will even go out of the screen when hovering bars.
However, if you remove the preceding div and keep only the chart, the tooltip position will work just fine.
Question: Looking forward for a tip in such case. How to keep the tooltip in place, even if there's some content with a dynamic height before the chart?
Thank you!
The text was updated successfully, but these errors were encountered: