output$plot_evolution <- renderHighchart({
dta <- dta_abcd_visit() |>
filter(! site == "_ALL SITES_")
if(input$aggregation_selection) {
return(
dta |>
group_by(timepoint, category) |> summarise(n = sum(n), .groups = "drop") |>
hchart(type = "column", hcaes(x = "timepoint", y = "n", group = "category")) |>
hc_yAxis(title = list(text = "%"), max = 115, endOnTick = FALSE, stackLabels = list(enabled = TRUE)) |>
hc_xAxis(title = "") |>
hc_colors(color_category) |>
hc_plotOptions(series = list(stacking = "percent"))
)
}
if(! input$aggregation_selection) {
return(
dta |>
group_by(timepoint, status) |> summarise(n = sum(n), .groups = "drop") |>
hchart(type = "column", hcaes(x = "timepoint", y = "n", group = "status")) |>
hc_yAxis(title = list(text = "%"), max = 115, endOnTick = FALSE, stackLabels = list(enabled = TRUE)) |>
hc_xAxis(title = "") |>
hc_colors(visit_status$color_status) |>
hc_plotOptions(series = list(stacking = "percent"))
)
}
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.