I'm new to visualizing with plotly and am trying to create an animated bubble chart. I have a dataframe of the happiness score, GDP per capita, Social support of all countries in the world from the years 2015 to 2019. I have followed a tutorial on how to make a simple animated bubble chart to slide over the years. This is my code:
fig = px.scatter(df_total_all_years, x="GDP per capita", y="Score", animation_frame='Year', animation_group='Country', size="Social support", color='Country',height=800, hover_name='Country', log_x=True, size_max=60)
fig.layout.updatemenus[0].buttons[0].args[1]['frame']['duration'] = 700
fig.update_layout(title="Happiness Score")
fig.show()
It does show me a bubble chart and I can slide the years but the values (the bubble charts) do not change when I slide over the years. When I hover over the bubbles it still shows me the value of 2015 when, for example, I have slided to the year 2019.
Can someone please advise me what I did wrong in my code?
Thank you so much!
