What I’m trying to do:
Add a vertical line to a graph object plot client side
What I’ve tried and what’s not working:
I’ve followed the plotly graph object documentation, and gotten it to work on my local machine, but I don’t yet understand how to modify this to the client logic.
#what i’m trying to do in the client environment
Code Sample:
’
#Works on my local machine
x = [1,2,3,4,5]
y = [4,5,2,7,8]
fig = go.Figure()
fig.add_trace(go.Scatter(x=x, y=y,
mode='lines+markers',
name='Spotprices'))
fig.add_vline(x=3, line_width=3, line_dash="dash", line_color="green")
fig.show()
#What i want to work in the client
x = [1,2,3,4,5]
y = [4,5,2,7,8]
self.plot_1.data = go.Scatter(x=x, y=y, mode='lines')
self.plot_1.figure.add_vline(x=3, line_width=3, line_dash="dash", line_color="green")
Thanks in advance