Skip to content

Legend disspaeres when checkboxes are selected #88

@yuliaUU

Description

@yuliaUU

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:
image
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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions