Hi, I wrote a code that filters the graph based on some inputs that are not part of the legend
library(plotly)
library(crosstalk)
# shared data object
shared_us <- SharedData$new(mtcars, key = ~cyl)
# scatterplot of housing price index against homeownership
p17 <- shared_us %>%
plot_ly(x = ~mpg, y = ~hp, color = ~gear, height = 400) %>%
add_markers()
# add a column of checkboxes for region to the left of the plot
bscols(widths = c(3, NA),
filter_checkbox(id = "cyl", label = "Cylinders", sharedData = shared_us, group = ~cyl),
p17
)
so, at first, none checkboxes are selected, and everything is showing nicely:

However, when I select one of the checkboxes, the legend disappears, I am not sure why.
I also was wondering whether there is an option to have the checkboxes checked? ( rather than them being unchecked)
Hi, I wrote a code that filters the graph based on some inputs that are not part of the legend
so, at first, none checkboxes are selected, and everything is showing nicely:

However, when I select one of the checkboxes, the legend disappears, I am not sure why.
I also was wondering whether there is an option to have the checkboxes checked? ( rather than them being unchecked)