Sort top 3 x axis by value instead of name

This commit is contained in:
2026-01-21 19:06:33 +01:00
parent 7a7b7f9a8a
commit b651e71276

View File

@@ -223,7 +223,7 @@ server <- function(input, output, session) {
year = "2024"
)
req(nrow(data_tibble) > 0)
ggplot(data_tibble, aes(x = Name, y = Erfasst, fill = Name)) +
ggplot(data_tibble, aes(x = reorder(Name, -Erfasst), y = Erfasst, fill = Name)) +
geom_col(width = 0.7) +
scale_x_discrete(
labels = function(x) str_wrap(x, width = 15)) +