Adding multiple vlines using the same input


I am trying to create a dash app where a user can add multiple vertical lines to a plot, but it’s an unknown amount. Some plots may have none, others may have 1, 2, 3, etc. I want just one input box that they can click over and over again to add lines. Any thoughts on how to do this? Will I just need a loop inside my callback that listens for this?


Hi, how do you want the user to fix the position of the vertical line? I suppose you don’t want to have multiple lines at the same place?

One way to do this by clicking into the graph and creating an annotation [or vlines] at the click position.

Here is an example:

This might be interesting too: