Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bb_labs

Quickly set title, axis labels and caption


Description

Quickly set title, axis labels and caption

Usage

bb_labs(
  bb,
  title = NULL,
  x = NULL,
  y = NULL,
  caption = NULL,
  caption_href = NULL
)

Arguments

bb

A billboard htmlwidget object.

title

Text for the chart title, use \n to make a new line.

x

Text for x axis title.

y

Text for y axis title.

caption

Text for the caption displayed in the bottom-right of the chart.

caption_href

Associate the caption with a link to an URL.

Value

A billboard htmlwidget object.

Note

caption is not part of the billboard.js library, it is added by the billboarder package.

Examples

data("prod_par_filiere")

billboarder() %>%
  bb_barchart(
    data = prod_par_filiere[, c("annee", "prod_hydraulique")],
    color = "#102246"
  ) %>%
  bb_legend(show = FALSE) %>%
  bb_labs(
    title = "French hydraulic production",
    y = "production (in terawatt-hours)",
    caption = "Data source: RTE (https://opendata.reseaux-energies.fr/)",
    caption_href = "https://opendata.reseaux-energies.fr/"
  )

billboarder

Create Interactive Chart with the JavaScript 'Billboard' Library

v0.3.1
MIT + file LICENSE
Authors
Victor Perrier [aut, cre], Fanny Meyer [aut], NAVER Corp [cph] (billboard.js library), Mike Bostock [cph] (d3.format library)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.