I have a dropdown menu, changing it will display different data (dataframe columns).
Can I set the default graph(default display after fig.show) to one of the function in the drop down menu instead of showing all the traces?
Thanks
Hi @Jonathan,
If fig.data
is a list of at least two traces, set visible=False
in the trace definition that you want to hide when plotting fig, before any selection from dropdown menu.
let us say you fig.data
consists in 3 traces. By default they are set visible. If you want to display only fig.data[0]
, then to hide fig.data[1]
, and fig.data[2]
do:
for k in [1,2]:
fig.update_traces(visible=False, selector=k)