Create a trend line.

reactrend(data, draw = FALSE, draw_duration = 3000,
  draw_easing = "ease-in", stroke = "#000", stroke_width = 1,
  stroke_opacity = 1, smooth = FALSE, line_cap = c("butt", "round",
  "square"), radius = 10, dash = NULL, dash_offset = 10,
  gradient = NULL, width = NULL, height = NULL, elementId = NULL)

Arguments

data

A vector of numerical values.

draw

Whether to use a drawing animation.

draw_duration

Duration of draw animation in milliseconds.

draw_easing

Easing to use for draw animation.

stroke

Color of trend line.

stroke_width

Width of stroke.

stroke_opacity

Opacity of stroke.

smooth

Whether to smooth trend line.

line_cap

Shape of line edges.

radius

Controls curve when smooth is set top TRUE.

dash

A vector of dash length.

dash_offset

Controls where dash starts.

gradient

Vector of colors to use as gradient.

width, height

Must be a valid CSS unit (like '100%', '400px', 'auto') or a number, which will be coerced to a string and have 'px' appended.

elementId

A valid CSS element id.

Examples

reactrend(runif(100)) reactrend( runif(20), gradient = c('#00c6ff', '#F0F', '#FF0'), smooth = TRUE, draw = TRUE, dash = c(1,7,3) )