I have a dataset, data, with the following values:
ID TIME Duration
A 12/18/2019 4:45:10 AM 1 sec
A 12/18/2019 9:06:59 PM 0 sec
B 12/19/2019 4:14:13 AM 7 sec
B 12/19/2019 4:14:20 AM 0 sec
A 12/18/2019 4:45:11 AM 0 sec
p <- plot_ly(data = df,
x = ~ID,
y = ~Duration,
name = "Title",
type = "bar",
orientation = 'v',
order = "ascending"
)%>%
layout(
title = "Title",
xaxis = list(title = "ID", tickangle = -45 ),
yaxis = list(title = "Time In Seconds"))
How would I specify that the graph is in ascending order like the picture below. categoryorder = 'ascending" is not working.