How to show streamgaph axes correctly in R-shiny?

235 views Asked by At

I was using streamgraph. It was working fine on standalone program, however, it was not working as expected on r-shiny. On R-shiny, the X-Axis just disappeared. Please see the figures attached. Can anyone please help me with this? Thank you.

Code to generate the case,

library(dplyr) library(streamgraph) library(ggplot2movies)

movies %>%
select(year, Action, Animation, Comedy, Drama, Documentary, Romance, Short) %>%
tidyr::gather(genre, value, -year) %>% group_by(year, genre) %>% tally(wt=value) %>% ungroup %>%
streamgraph("genre", "n", "year") %>% sg_axis_x(20) %>%
sg_fill_brewer("PuOr") %>%
sg_legend(show=TRUE, label="Genres: ")

Figure 1 (with visitble X - Axis ) enter image description here

Figure 2 (On R-shiny, X - Axis is not visible ) enter image description here

0

There are 0 answers