This is the code to hide the graph and display the appropriate legend when clicked
library(plotly) library(tidyr) library(plyr) data <- spread(Ora