I am trying to create a chart with a bar trace and a scatter trace. I want to control the legend thru the same group but it doesnt work
graph_hist <- plot_ly(source="histPlot") %>% add_trace(y=g$Pct, x=g$lot_wafer, color=g$name, type="bar", key=g$name, legendgroup=g$name, showlegend=F) %>% add_trace(y=g$Pct, x=g$lot_wafer, color=g$name , type="scatter", key=g$lot_wafer,legendgroup=g$name, showlegend=T, opacity=1) %>% layout(dragmode="select", barmode="stack")
Any help? Main reason for doing the 2 traces is because plotly_selected is not supported for bar chart
Thanks