dreamRs / billboarder

:bar_chart: R Htmlwidget for billboard.js
https://dreamrs.github.io/billboarder/
Other
174 stars 21 forks source link

Lower part of caption is cut #17

Closed newuserofthis closed 4 years ago

newuserofthis commented 4 years ago

Dear billboarder team,

thanks for your wonderful R package. I have a minor problem with the display of a chart's caption. The lower part of it is missing. I added bb_opts = list(padding = list(bottom=100)) as argument to the billboarder() function. It works but gets overwritten when the bb_labs() function is called with a caption argument. How can the bottom margin be enlarged after calling the bb_labs() function? Or is there another way of displaying the caption entirely. Thanks for your help!

Anja

library("billboarder")

# data
data("prod_par_filiere")

# a bar chart !
billboarder() %>%
  bb_barchart(data = prod_par_filiere[, c("annee", "prod_hydraulique")], color = "#102246") %>%
  bb_y_grid(show = TRUE) %>%
  bb_y_axis(tick = list(format = suffix("TWh")),
            label = list(text = "production (in terawatt-hours)", position = "outer-top")) %>% 
  bb_legend(show = FALSE) %>% 
  bb_labs(title = "French hydraulic production",
          caption = "gqpjy: RTE (https://opendata.rte-france.com)")
pvictor commented 4 years ago

Hello,

Thanks for reporting this, it should be fixed:

image

I also added ar argument to use caption as a link.

Please install from GitHub to have latest version, I'll submit to CRAN soon.

Victor

newuserofthis commented 4 years ago

Thank you for the quick fix, Victor! Works like a charm!

Best wishes Anja