Plotly R : Modify several attributes from a single restyle button

So, I managed to find my solution. args is a list of list, then each arg is a list (seems obvious now :p).

                    ## This one works.                                                                                                                                                                                                     
                    list( type="buttons", y = 0.3,
                         buttons = list(
                             list(method = "restyle",
                                  args = list( list( y = list(myData$Y1), mode = list("lines"))),
                                  label = "0 - Modify 2 attributes via restyle: y=Y1; mode=line [The solution]"),
                             list(method = "restyle",
                                  args = list( list( y = list(myData$Y2), mode = list("markers"))),
                                  label = "1 - Modify 2 attributes via restyle: y=Y2; mode=markers [The solution]")
                         )
                         ),

Hoping it will save time and patience for others ! :slight_smile:

2 Likes