-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add attributes to customize hover text font #102
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
Comments
@mheilman
|
Ah, OK, thanks for the clarification on It'd be nice to be able to set the hover text because I don't think it's possible now to have a consistent font in a scatter plot other than with the default font. I think CSS would just get overridden because the font is set explicitly in the tag using the I could be missing something, though. Maybe there's some way to change the mouse over event, but that seems complicated. Thanks. |
@mheilman you could hook on a hover event handler (example). Something like graphDiv.on('plotly_hover', function(data) {
querySelectorAll(".hovertext text").forEach( /* ... */);
// ...
}); But, yeah, there's no way customize the font of the hover labels in the plot API at the moment. I'm renaming this issue as a feature request. |
Would you also consider, together with this feature, adding the ability to set the color of the hover boxes (perhaps to an arbitrary array of colors?) I believe it currently just defaults to the color of the first marker, for all hover boxes. In the meantime, I'll try a workaround where I change the color on the hover event as per @etpinard 's suggestion above. |
I'm planning on implementing this as soon as #1573 is merged. |
Hello guys, the simple font: {color: 'COLOR'} inside hover configuration works for me, in the v1.41.3. I figure out that one style element of a D3js chart (on CSS), the ".line" attribute, was setting the color of hover text on plotly. |
The font attribute doesn't affect the text in the "hoverlayer" div. At the moment, it doesn't look like there's a way to specify that hover text font family.
Here's a minimal example. The font for the axis labels gets changed, but not for the hover text.
Note: I used Comic Sans MS because it's obvious, not because I actually want it in my chart :-)
Semi-related: The "font" property is mislabeled as "textfont" in the docs). "textfont" doesn't appear to do anything.
The text was updated successfully, but these errors were encountered: