1

I have a line chart using plotly on which I track events of interest by adding vline as markers representing the events. Annotation on the vline describes the events. When the lines are close enough, the annotations overlap with each other and become unreadable.

Heres an example:

enter image description here

Is there a way I can make these annotations show up only when hovering on the line? How do I achieve this?

Aadith Ramia
  • 10,005
  • 19
  • 67
  • 86
  • 1
    without moving to a **dash** app with callbacks I don't see any way to achieve this – Rob Raymond Sep 07 '22 at 19:22
  • If you add text in line mode on a scatter plot, the text will appear on hover. The sample code is as follows. `fig = go.Figure(data=go.Scatter(x=[0,0], y=[1,0], mode='lines', hovertext='description'))` – r-beginners Sep 08 '22 at 02:43

0 Answers0