diff --git a/app.R b/app.R index f5f6042..c06e393 100644 --- a/app.R +++ b/app.R @@ -560,9 +560,7 @@ server <- function(input, output, session) { if (nrow(boxPlot) > 0) { palette <- brewer.pal(length(legends), "RdYlGn") - #print(palette) - - colours <- palette[as.integer(boxPlot$Group)] + names(palette) <- 1:length(legends) #print(paste("Box plot, colours", nrow(boxPlot), length(colours))) #cat(colours) @@ -570,7 +568,7 @@ server <- function(input, output, session) { categoryarray = boxPlot[,1], zerolinewidth = 10) # - plot_ly(boxPlot, x = boxPlot[,1], y = ~Range, color = colours, colors = palette, type = "box") %>% + plot_ly(boxPlot, x = boxPlot[,1], y = ~Range, color = as.character(boxPlot$Group), colors = palette, type = "box") %>% layout(xaxis = xform, showlegend = FALSE, title = title) }