-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Can't find a way to disable hovertext automatic rotation #2170
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
You're right, we don't expose a way to set the hover label rotation at the moment. I guess we could add something like: hoverlabel: {
angle: 90 // or [10, 90, 45] one item per-pt
} but that might not cover all the current label rotation logic. |
Thank you for the response. My workaround was to use a single data trace and change colors as needed programmatically. This doesn't cause rotation, as apparently the function hoverAvoidOverlaps can see there is more room available in the total chart with a single data trace. |
+1 for the angle parameter at the hoverlabels. |
+2 The solution that @desertdev proposes works. However, in the case I'm working on right now, I need to have several traces, because I want to map different colors to different categorical variables, and it's quite difficult to read at 45 and -45 degrees. Exposing the logic under |
@etpinard Sure, I put an example here https://plot.ly/~victor.chubukov/18/ |
This is an extreme example of what I posted in #3050 (comment) and I said:
That would fix the green label here, but I guess the fact that the orange label crosses the blue shows there's more needed - in principle all the labels except the farthest-right would need to be pushed down somewhat, though we should be careful not to push them down any more than we need do or they could easily drop off the bottom of the plot... Simply disabling this rotation (which we do if you switch to |
@alexcjohnson thanks for the tip -- |
This issue has been tagged with A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort. What Sponsorship includes:
Please include the link to this issue when contacting us to discuss. |
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson |
I have a horizontal bar chart using hover text that is automatically being rotated about 45 degrees, which I don't want. I've been combing through the API full reference and existing issues (open and closed), but have not found any way to change this:
One detail in the data: there are 2 traces being charted, one in blue and one in grey. Initially all the data was in a single trace and I didn't have this problem. But both traces have identical options set for the hovertext:
Am I just missing something or is it not possible to avoid this rotation? There seems to be plenty of room for the hovertext, and even if I reduce the text content to a very short string on a single line it still wants to do the rotation now that I split it into 2 traces.
The text was updated successfully, but these errors were encountered: