Sort top 3 x axis by value instead of name
This commit is contained in:
2
server.R
2
server.R
@@ -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)) +
|
||||
|
||||
Reference in New Issue
Block a user