-
Notifications
You must be signed in to change notification settings - Fork 237
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
Left label identification by class or id #272
Comments
I actually have that functionality implemented somewhere. You could make the chart add a div and then position the tooltip, however as the chart is not returning a div to wrap it in, I don't think that would be a nice solution. The demo example shows how one can add it to the drops. Currently, I have something similar, where I attach a callback on mouseover on the text labels. In D3 it's easy to get the value and it works quite well. Maybe also add ellipisis to the text (the name) and not the numbers, so in case the text get's quite big it can overflow? Or maybe allow setting a different font-size. Personally, I use popper.js to position the tooltip as some of mine are quite big. |
@Sarseth I use a function to get the text length (as font's differ) then if the length is more, I shorten it until it will fit the screen, as well as ...; .text(function(d) {
// Add the text and any logic you need
// If the length is too long, add a shortName to the data element
}).on('mouseover', function(d) {
if (d.shortName !== undefined) {
onMouseOver(d);
}
}) Edit: |
Awesome, thanks, will tinker with what you provide here tomorrow :) |
So I made a PR to expose the Here is an example, where index.js is the EventDrop with the tooltip added (Couldn't paste it on JsBin as too large). |
It'd be nice to have way to hook anything to line-labels. Like tooltips when mouse over. atm only way to find it, is a txt that and it changes when user scroll it.
maybe even integrated tooltip mechanism for that :)
The text was updated successfully, but these errors were encountered: