# Is there a way to add a vertical line with hovertext to a graph that scales automatically (yref to paper)?

**URL:** <https://community.plotly.com/t/is-there-a-way-to-add-a-vertical-line-with-hovertext-to-a-graph-that-scales-automatically-yref-to-paper/30070>\
**Category:** Dash Python\
**Created:** [October 15, 2019, 8:30pm UTC](https://community.plotly.com/t/is-there-a-way-to-add-a-vertical-line-with-hovertext-to-a-graph-that-scales-automatically-yref-to-paper/30070 "2019-10-15T20:30:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimark](https://avatars.discourse-cdn.com/v4/letter/d/db5fbb/32.png) [@dimark](https://community.plotly.com/u/dimark)\
**Post date:** [October 15, 2019, 8:30pm UTC](https://community.plotly.com/t/is-there-a-way-to-add-a-vertical-line-with-hovertext-to-a-graph-that-scales-automatically-yref-to-paper/30070/1 "2019-10-15T20:30:07Z")

</div>

I am trying to add a vertical line in a graph that displays text if you hover it.  
A vertical line that always goes from top to bottom can be done with shapes and setting yref=‘paper’. But unfortunately you cant add hovertext to shapes.  
Then I tried to plot a vertical line. With that you can set up hover text, but then it doesnt scale infinitely if you zoom out for example.

Is there any way to get both, hovertext and a vertical line over the graph?

---

<div class="post-metadata">

**Author:** ![alexcjohnson](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/alexcjohnson/32/614_2.png) [@alexcjohnson](https://community.plotly.com/u/alexcjohnson)\
**Post date:** [October 15, 2019, 10:06pm UTC](https://community.plotly.com/t/is-there-a-way-to-add-a-vertical-line-with-hovertext-to-a-graph-that-scales-automatically-yref-to-paper/30070/2 "2019-10-15T22:06:18Z")

</div>

You could try making a line trace on a second y axis, then hide that axis and make it `fixedrange: true`  
[https://codepen.io/alexcjohnson/pen/dyyXoQz?editors=1010](https://codepen.io/alexcjohnson/pen/dyyXoQz?editors=1010)
