✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

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)?


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


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:


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

No. I never did, sorry.