I’m creating a Dash webapp where i have a real-time plotly chart. This chart gets updated every second. I would like to add to my X axis time instead of a fixed value. I tried setting tickvals=
to dt.now
but it doesn’t work, since tickvals
needs an array. Any advice?
def gen_wind_speed(interval):
trace = Scatter(
y=df['num'],
line=Line(
color='#42C4F7'
),
)
layout = Layout(
height=450,
xaxis=dict(
showgrid=False,
showline=False,
zeroline=False,
fixedrange=True,
tickvals= dt.now
),
margin=Margin(
t=45,
l=50,
r=50
)
)
return Figure(data=[trace], layout=layout)