Hover Labels Overlap

Something about my plot is causing the hover labels to overlap. In this plot:
I have quite a few individual traces, all of them are toggled off initially, so you need to click one of the legend groups to see the issue. But when you hover over a location of closely spaced traces, all of the hover labels overlap, obscuring the values in the hover text. The image below shows a sample of what I’m seeing. Is this the intended behavior? I thought they were supposed to stack in a way that allowed all of the labels to be visible?


You can change hovermode (https://plot.ly/python/reference/#layout-hovermode). I think your current default is hovermode="x" so it shows all the hoverinfo with the same xaxis. You can change it to "closest".

Thanks. Technically, that does solve my overlapping labels, but does so by only showing 1 at a time. I still want to see all of them. like in the image below from the line chart explanation page https://plot.ly/python/line-charts/

Here there are multiple traces with very close data points, but the hover labels are nicely arranged so that they’re all visible. Thats what I’m trying to get.

Hi @tfg250,

Could you open a bug report in the plotly.js project at https://github.com/plotly/plotly.js/issues ? Just include a small example (in Python is fine) that is as simple as you can make it while still reproducing the overlap issue.


thanks, just submitted as https://github.com/plotly/plotly.js/issues/3603

1 Like