-
Notifications
You must be signed in to change notification settings - Fork 715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding tooltip to x/y axis tick labels #944
Comments
I guess this happens because you are mixing html (Tooltip component) with the SVG ( Example
|
I think @kiranvj is probably right that it's failing due to rendering HTML as a child of an SVG element. One alternative solution then would be to render the HTML tooltip inside a react Portal. We actually export |
Here's a working demo. Likely can still optimize the size of the tick mouse target and the tooltip positioning / styles (should be able to use material styles inside the Portal if you need) but illustrates the general approach. Just to explain the |
Cool. Thanks @williaster for the quick response. I'll give it a try :) |
Going to close this for now, please feel free to re-open if you have any more questions/issues! |
Hi Guys,
I'm trying to add a Tooltip (MaterialUI) on
<AxisLeft/>
currently using tickComponent. Reason is that I'm getting lengthy characters in y axis and I need to trim it and show. But when the user hovers the axis label, we need to show the entire text.Doesn't work -
But if I remove the Tooltip wrapper, it will work.
Works-
Also, if I don't use
<text/>
component and the{...tickProps}
, then I have to manually code and position all the axis labels, I guess.So is there any way to achieve this
Any thought on this ?
Thanks,
Abi
The text was updated successfully, but these errors were encountered: