line_chart_dense: Line chart with more points then categories on x-axis.

Description Usage Arguments Value Examples

View source: R/line_chart_dense.R

Description

Line chart with more points then categories on x-axis.

Usage

1
line_chart_dense(data, dates, series, interval = "months")

Arguments

data

Data frame in wide format.

dates

Name of column in 'data' which contains dates or vector of dates.

series

Vector of column names in 'data' with values of time series.

interval

Granularity of x axis. One of c('weeks', 'months', 'quarters', 'years'). Default value is 'months'.

Value

object of class tidychart with a character vector containing SVG elements

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
df <- data.frame(
 x = seq.Date(as.Date('2021-01-01'), as.Date('2021-07-01'), length.out = 200),
 'Company_sin' = 5 * sin(seq(
   from = 0,
   to = 2 * pi,
   length.out = 200
   )) +  rnorm(200, mean = 5, sd = 0.5),
 'Company_cos' = 5 * cos(seq(
   from = 0,
   to = 2 * pi,
   length.out = 200
 )) +  rnorm(200, mean = 5, sd = 0.5))

df <- head(df, n = 199)

line_chart_dense(
  df,
  dates = 'x',
  series = c('Company_sin', 'Company_cos'))

tidycharts documentation built on Jan. 18, 2022, 5:07 p.m.