Black Lives Matter. Please consider donating to Black Girls Code today.

Pie chart drop down menu change data

Hello,

I want to create pie plot that show different values for inputs selected in drop-down menu. I have two data frames to show in pie chart. The code does not change anything when i choose from menu. What is wrong with the code?

Thanks for your help !

The code is:
fig = go.Figure(data=[go.Pie(labels=df1[“Label”],
values=df1[“Value1”], textinfo=‘label+percent’)])

fig.update_layout(updatemenus=list([dict(buttons=list([
dict(label=“Value1”, method=“update”, args=[{‘visible’: [True,True]}, {“labels”: df1[“Label”], “values”: df1[“Value1”]}]),
dict(label=“Value2”, method=“update”,
args=[{‘visible’: [True,True]}, {“labels”: df2[“Label”], “values”: df2[“Value2”]}])],
)
)]
))
fig.show()