Description Usage Arguments Value Examples
View source: R/line_chart_dense.R
Line chart with more points then categories on x-axis.
1 | line_chart_dense(data, dates, series, interval = "months")
|
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'. |
object of class tidychart with a character vector containing SVG elements
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'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.