Is it Possible to Control the Position of the Hoverlabel Box?

I thought that all the hover labels would automagically orient relative to the size of my Choropleth map but my east coast States are getting cut off. Any suggestions (other than resizing my map size)?

LabelCutoff

Hi @russmcb
does it help if you use hover trace align attribute?

fig.update_traces(hoverlabel=dict(align="left")

Thanks @adamschroeder. Thatā€™s what I was hoping too, but, alas, it just aligns the text inside hover label box, and Iā€™m looking to align the box itself.

I know you didnā€™t want to change the graph size, but maybe manually setting margin of the right side would fix the hover from cutting off.
Hereā€™s a relevant conversation on margin

And hereā€™s another conversation that might help.

Thanks @adamschroeder, automargin sort of works when I delete my margin= line (still slight cutoffs but much better). The bummer is that Iā€™ve now got a bunch of blank space on the right side of the map and a much smaller map simply because now thereā€™s enough space to orient all the Hovertext boxes to the right. I know they can ā€œauto-adjustā€ to left or right since some of the ones further right (like Maine) will sometimes flip to a left side orientation.

If there was a way to programmatically control their orientation I wouldnā€™t mind creating a dictionary for all 50 states to control each oneā€™s hover label box positionā€¦ but I canā€™t seem to find any property anywhere to control the orientation.

Having the same issue on my bar chart hoverlabels:

Cuttoff-2

2 Likes

Hi! Did you get a way to control the hoverlabel position? Thanks. :grinning:

No. I never did, sorry.

Russ

I guess this is still not a possibility. I have the same problem, but in my case itā€™s a problem with the hoverlabel of an annotation that is cut at the bottom:

Annotation being cut

Itā€™d be good to at least select yanchor/xanchor for the hoverlabel.

1 Like

iam facing the same issueā€¦is it possible to show the hoverinfo according to our choice is there any customized way to do ?
image

hi @ranjith061
do you mean show what info is shown in the hoverbox or control the position of the hoverbox?

Is this something that is even on the radar? I have a unified x hoverlabel for a series of stacked bars and the hover label box completely covers all of the bars, which is obviously not a desired behavior.

I would also love to be able to more granularly control what appears in the label.

For example, I want to get rid of the legend colors that show up in the label. I have ShowLegend set to False although if I print out the fig[ā€˜dataā€™] it shows it set to true.

Iā€™m also struggling to figure out how to get rid of the x-label showing in the left hand corner and trying to figure out whether it is possible to insert a variable (from the dataframe) only once at the top of the hover label. E.g., I have a 100% stacked bar and would like to have the ā€˜denominatorā€™ displayed only once, at the top, rather than four times, one for each label.

Once I get back to my other computer, Iā€™ll throw up some sample code illustrating the problem.