Hide/show line in live graph

I have a live graph, which plots 4 lines from a db. I want to hide or show only line, that the client want to show or hide.
I have tried the uirevision by layout, but it is a live data so by every interval the graph will reload again!
Any idea?

I found an easy solution by just turning animate = True by the dcc.Graph and then just click on the legend to hide/show the plot line.