Learn R Programming

g2r (version 0.1.0)

chart-title: Title & Subtitle

Description

Add a chart title and subtitle.

Usage

add_title(g2, ..., position = c("top", "bottom"), tag = htmltools::h1,
  inherit_padding = TRUE, font_family = NULL)

add_subtitle(g2, ..., position = c("top", "bottom"), tag = htmltools::h4, inherit_padding = TRUE, font_family = NULL)

Arguments

g2

An object of class g2r as returned by g2r.

...

Title or subtitle content and style, passed to tag.

position

Position of title or subtitle, top or bottom.

tag

A valid html tag tag.

inherit_padding

Whether to inherits the left padding set on chart object (g2).

font_family

Font family to use, if NULL sets to default set by conf_font.

Examples

Run this code
# NOT RUN {
g2(fruits, asp(fruit, value)) %>% 
  fig_interval() %>% 
  add_title("Fruits")

# }

Run the code above in your browser using DataLab