Plotly Typeerror

What I’m trying to do:
trying to create a plotly graph


**What I've tried and what's not working:**
add_trace method for go.Figure() is not workig


**My Code:**
import plotly.graph_objects as go
fig = go.Figure()
fig.add_traces(go.Scatter(x=[x for x in range(10)],y=[x for x in range(10)],line=dict(color='#FF0000')))

It throws the following error:
TypeError: 'WrappedObject' object is not callable

Try this: Plotly: figure.add_trace(..) not working (double scatter graph)

Hi,
Thank you. While this solution works, the issue for me is i will be adding figure.add_trace(…) once the user clicks on the graph so using this solution take some time since i need to send data to the server side, create graph and then send it to the client side.

so, in this case i need it to process at client side as it is connected to a real time database.

You say real time database, is it Anvil’s DB or an external one (mongo)? You could always create the plot when you pull the data from the DB, which I assume would need to be done in a server function anyway

Yes, but the issue is figure.add_trace(…) should run once the user clicks on the graph, the issue is it take a while for me to send the data back to server.
what im trying to do is draw a line when user clicks on some point in the graph
i am using external database