How i can solve it 'layout' objects don't have these attributes: 'violinmode'

61 Views Asked by At

My code is

if (selected_chart_type == "RidgeLine Plot") {
      fig <- plot_ly(data = age_group_populations, x = ~t04cp02, y = ~t04v01, color = ~t04tehname, type = "violin", colors = color_palette) %>%
        layout(title = paste("District Population by Age (Ridge Line Plot) in", selected_district, ",", selected_province),
               xaxis = list(title = "Population (%)"),
               yaxis = list(title = "Age"),
               violinmode = "overlay", # Overlaying violins for better comparison
               template = "plotly_dark")
    }

and the error is

Warning: 'layout' objects don't have these attributes: 'violinmode'

I want to genarate a ridge line plot using these parameters

0

There are 0 best solutions below