thomas-neitmann/ggcharts

Legend pops up when changing theme

thomas-neitmann opened this issue · 1 comments

Currently, the highlight feature is implement via scale_fill_manual(). This has the consequence that when changing the theme a legend pops up. Implementing the highlight feature via scall_fill_identity() should fix this.

plot <- biomedicalrevenue %>%
  filter(year == 2014) %>%
  bar_chart(company, revenue, limit = 10, highlight = "Sanofi") %>%
  print()

image

plot + theme_classic()

image

The same happens with diverging_*_chart().

data(mtcars)
mtcars_z <- dplyr::transmute(
  .data = mtcars,
  model = row.names(mtcars),
  hpz = scale(hp)
)

p <- diverging_bar_chart(mtcars_z, model, hpz)

image

p + theme_classic()

image