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

bb_add_style

Add custom style for regions and grid lines


Description

Add custom style for regions and grid lines

Usage

bb_add_style(
  bb,
  region = NULL,
  x_grid = NULL,
  y_grid = NULL,
  ...,
  .list = NULL
)

Arguments

bb

A billboard htmlwidget object.

region

A named list with style associated with region.

x_grid

A named list with style associated with grid line on the X-axis.

y_grid

A named list with style associated with grid line on the Y-axis.

..., .list

Used internally.

Value

A billboard htmlwidget object.

Examples

# Change default color for regions
billboarder() %>% 
  bb_linechart(data = sin(seq(-pi, pi, length.out = 30))) %>% 
  bb_regions(
    list(start = 0, end = 10, class = "custom"), # add custom class
    list(start = 19, end = 29, class = "foo")
  ) %>% 
  bb_add_style(region = list(custom = "fill: red;", foo = "fill: #009246;"))

# Customize grid line and text
billboarder() %>% 
  bb_linechart(data = sin(seq(-pi, pi, length.out = 30))) %>% 
  bb_y_grid(lines = list(list(
    value = 0, text = "Zero", position  = "middle", class = "zero"
  ))) %>% 
  bb_add_style(y_grid = list(
    zero = list(line = "stroke: red", text = "font-size: 240%; fill: black"
  )))

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.