sample data
Country State City Currency Tasks Accidents
IND KR BLR INR 1000 500
IND WB CCU INR 2500 200
SL SL COL SLR 500 400
JAP JAP TOK YEN 400 300
AUS MB MB AD 200 4000
AUS SY SY AD 3000 400
AUS AD AD AD 5000 300
Need graph like below which is something like waterfall model ![![Graph requirement][1]][1] Y axis - Country IND SL JAP AUS X axis- Tasks Accidents
tried below two codes
ggplot(df,aes(Country,fill=Value))+
geom_rect(aes( x = Country,xmin = Current_no, xmax = Current_no , ymin = Current_no, ymax = Current_no))
Sample data
Country state City flag value
IND KA BLR . Tasks 8200
IND WB CCU Tasks 2500
IND KA BLR . Accidents 700
p <- plot_ly(
df_melt, name = "20", type = "waterfall", measure = ~value,
x = ~Flag, textposition = "outside", y= ~Country,
connector = list(line = list(color= "rgb(63, 60, 50, 40, 44, 34, 21)"))) %>%
layout(title = "Exp Output",
xaxis = list(title = ""),
yaxis = list(title = ""),
autosize = TRUE,
showlegend = TRUE)
p
Not getting expected output