Black Lives Matter. Please consider donating to Black Girls Code today.
Dash HoloViews is now available! Check out the docs.

Custom Button (Python) - Change Line Graph to Scatter

Hi Everyone,

Leveraging the Custom Button Tutorial and using the code below, I am trying to change the type of plot from line to scatter just like if you were to change the plot from surface or heatmap in the tutorial example. I believe the button is working since I tested it with using the surface or heatmap instead of using ‘scatter’. However, when testing it with surface or heatmap, the plot changes to surface/heatmap but is blank and when using ‘type’,‘scatter’, the button doesn’t do anything. Can you all help me figure this out? Thank you for your help! Plotly is very awesome by the way!

> updatemenus=list([
> dict(
>     buttons=list([   
>         dict(
>             args=['type', 'scatter'],
>             label='Scatter',
>             method='restyle'
>         ),      
>     ]),
>     direction = 'left',
>     pad = {'r': 10, 't': 10},
>     showactive = True,
>     type = 'buttons',
>     x = 0.1,
>     xanchor = 'left',
>     y = 1.1,
>     yanchor = 'top'
> ),
> ])