https://drive.google.com/file/d/1dZzu5BPVtzP4y6Leb6712-1C_hBPXjX_/view?usp=sharing
I'm trying to create a interactive bar plot using ploty in R. The link contains the dataset that I'm working.
This is my code but the output is totaly different from what expected
df<- read.csv("continental_death_total.csv")
fig <- df %>%
plot_ly(
x = ~continent,
y = ~continental_sum,
frame = ~date,
type = 'bar',
mode = 'markers',
showlegend = F
)
fig
You could use the following code with type = "bar"
(Click on the play button to see the bars on each date):
df<- read.csv("continental_death_total.csv")
library(dplyr)
library(plotly)
fig <- df %>%
plot_ly(
x = ~continent,
y = ~continental_sum,
frame = ~date,
type = 'bar',
showlegend = F
)
fig
Output:
You can check the docs for more information and examples.