✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Transform filter on histogram not being applied

HI

First post on here, so please be gentle! I am trying to render a histogram via r Shiny with one transform filter applied. However, it only applies the value of the one item in the filter list to the histogram not all or any that are added. I would like it to be 1 or many of the options that are selected that get applied and sum up the count. So if I select CIO, its 10, if its CIO and CPP then its 10+14. Am I being a total div?! TIA!

This is the code;

Blockquote SERVER
output$p <- renderPlotly({
plot_ly(projection, x = ~projection$Month, color = ~projection$Simple,
transforms = list(
list(
type = ‘filter’,
target = ~projection$ProductCode,
operation = ‘in’,
value = input$Product
#value = paste(input$Product, collapse = ", ")
))
) %>%
add_histogram()
})

Blockquote UI
selectizeInput(
inputId = “Product”,
label = “Select a product code”,
choices = unique(projection$ProductCode),
selected = “CPO”,
multiple = TRUE),

                              plotlyOutput(outputId = "p")