Hi @abiyug. You may try the following code and text color to visualise it.
library(tidyverse)
df <- data.frame(structure(list(Animals = structure(c(1L, 1L, 1L, 3L, 3L, 3L,
2L, 2L, 2L), .Label = c("giraffes", "monkeys", "orangutans"), class = "factor"),
name = c("SF_Zoo", "LA_Zoo", "DC_Zoo", "SF_Zoo", "LA_Zoo",
"DC_Zoo", "SF_Zoo", "LA_Zoo", "DC_Zoo"), value = c(20, 12,
6, 14, 18, 14, 23, 29, 25)), .Names = c("Animals", "name",
"value"), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-9L)))
df %>%
mutate(name = factor(name, levels = c("SF_Zoo", "LA_Zoo", "DC_Zoo"))) %>%
plotly::plot_ly(x = ~ Animals, y = ~ value, color = ~name, type = "bar",
text = df$value, textposition = "auto", textfont = list(color = 'rgb(0,0,0)'))