The following restyling syntax does work:
using PlotlyJS
Period1 = 1950:2050; u = (Period1 .- 1950)/100;
GDP = u/2; INV = u; CONS = u*2; EXP = 2*u.^0.5;
p2 = PlotlyJS.plot(Period1, [GDP INV CONS EXP],
Layout(title = "Some macroeconomic aggregates: US (1960-Q1--2019-Q2)",
xaxis_title = "Quarterly observations",
xaxis_range = [1960, 2020],
yaxis_title = "Billions US dollars",
yaxis_range=[0, 2])
)
restyle!(p2,1:4, name=["GDP", "INV", "CONS", "EXP"])