bb_add_style {billboarder}R Documentation

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"
  )))


[Package billboarder version 0.4.1 Index]