I am trying to create a plot wherein i can compare a particular column values which is there in both data frames .
ALso highlight few colors taking a 3rd column values into consideration .
I tried using plot_ly
and add_trace
but its not the best solution i guess . Can someone help
plot_ly(data = Data%>%
select(Code, Description, Type, Group)%>%
filter(Type %in% c('Exc'))%>%
group_by(Code, Description, Type)%>%
summarize(count = n())
, x = ~Code, y = ~count,type = 'bar',
# text = ~count, textposition = 'auto',textfont = list(color = '#000000', size = 10),
name = 'Old', marker = list(color = 'blue'))%>%
add_text(text = ~count, textposition = "top",textfont = list(color = '#000000', size = 15)) %>%
add_trace(data = New, x = ~Code, y = ~count1, type = 'bar',
text = ~count1, textposition = 'auto',textfont = list(color = 'black',size = 1000),
name = 'New', marker = list(color = 'orange'))%>%
layout(xaxis = list(title = "Comparision"),
yaxis = list(title = 'Number of Users')