c_theme: Theme

Description Usage Arguments Point Styles Stepped Line Line Fill Modes Examples

View source: R/theme.R

Description

Define chart theme.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
c_theme(
  c,
  point_radius = 3,
  point_style = "circle",
  point_rotation = 0,
  point_color = "rgba(0, 0, 0, 0.1)",
  point_border_color = "rgba(0, 0, 0, 0.1)",
  point_border_width = 1,
  point_hit_radius = 1,
  point_hover_radius = 4,
  point_hover_border_width = 1,
  line_tension = 0.4,
  line_color = "rgba(0, 0, 0, 0.1)",
  line_border_width = 3,
  line_border_color = "rgba(0, 0, 0, 0.1)",
  line_border_cap_style = c("butt", "round", "square"),
  line_border_dash = NULL,
  line_border_dash_offset = 0,
  line_border_join_style = c("miter", "bevel", "round"),
  line_cap_bezier = TRUE,
  line_cubic_interpolation = c("default", "monotone"),
  line_fill = TRUE,
  line_stepped = FALSE,
  rect_color = "rgba(0, 0, 0, 0.1)",
  rect_border_width = 0,
  rect_border_color = "rgba(0, 0, 0, 0.1)",
  rect_border_skip = c("bottom", "left", "top", "right"),
  arc_angle = NULL,
  arc_color = "rgba(0, 0, 0, 0.1)",
  arc_border_align = "center",
  arc_border_color = "#fff",
  arc_border_width = 2
)

Arguments

c

An object of class charter as returned by c_hart.

point_radius

Point radius.

point_style

Point style, see section below.

point_rotation

Point rotation in degrees.

point_color

Point fill color.

point_border_color

Point border color.

point_border_width

Point stroke width.

point_hit_radius

Extra radius added to point radius for hit detection.

point_hover_radius

Point radius when hovered.

point_hover_border_width

Stroke width when hovered.

line_tension

Bézier curve tension (0 for no Bézier curves).

line_color

Line fill color.

line_border_width

Line border width.

line_border_color

Line stroke color.

line_border_cap_style

Line cap style

line_border_dash

Line dash, see MDN.

line_border_dash_offset

Line dash offset value.

line_border_join_style

Line join style.

line_cap_bezier

Set to TRUE to keep Bézier control inside the chart, FALSE for no restriction.

line_cubic_interpolation

Interpolation mode to apply.

line_fill

How to fill the area under the line.

line_stepped

Set to TRUE to show the line as a stepped line (tension will be ignored).

rect_color

Bar fill color.

rect_border_width

Bar stroke width.

rect_border_color

Bar stroke color.

rect_border_skip

Border to exclude.

arc_angle

A numeric defining arc angle to cover, defaults to circumference / (arc count).

arc_color

Arc fill color.

arc_border_align

Arc stroke alignment.

arc_border_color

Arc border color.

arc_border_width

Arc border width.

Point Styles

Stepped Line

Line Fill Modes

Examples

1
2
3
c_hart(cars, caes(speed, dist)) %>% 
 c_line() %>% 
 c_theme(point_radius = 8)

JohnCoene/charter documentation built on Feb. 20, 2022, 11:07 p.m.