How to create non stacked waterfall?

I am trying to create a waterfall chart in plotly, ie two bars next to each other in each g

data <- data.frame(x = c("A", "B", "A", "B"),
                   g= c(1, 1, 2, 2),
                   y = 10, 30 ,50 ,60)
plot_ly(
  data, type = "waterfall", measure = ~x, 
  x = ~g, y= ~y,
  connector = list(visible = FALSE))

"g" is not defined in the snippet of code you gave so we can't be sure what it refers to.

i have corrected it... g instead of year