View source: R/djpr_ts_linechart.R
djpr_ts_linechart | R Documentation |
Create a standard time series linechart with DJPR characteristics
djpr_ts_linechart(
data,
y_var = .data$value,
col_var = .data$series,
group_var = NULL,
dot = TRUE,
label = TRUE,
label_num = round2(.data$value, 1),
y_labels = ggplot2::waiver(),
hline = NULL,
n_x_breaks = 5,
x_expand_mult = c(0, 0.18),
label_single_line = FALSE,
label_wrap_length = 10
)
data |
A dataframe containing time series data. Your dataframe is presumed to include, at a minimum:
|
y_var |
Variable in |
col_var |
Variable in |
group_var |
Variable in |
dot |
Logical; |
label |
Logical; |
label_num |
Variable name (or expression) defining the label to be placed
on the chart. Default is |
y_labels |
Supplied to the |
hline |
Numeric. If non- |
n_x_breaks |
Number of 'pretty' breaks on the x (date) axis.
Passed to |
x_expand_mult |
Length one or two numeric vector of padding to be added
to the horizontal axis; passed to the |
label_single_line |
Logical. |
label_wrap_length |
Numeric. The number of characters on each line of the label. Default is 10 characters. |
If a column called 'tooltip' is present, it will be used as the ggiraph tooltip; if not, one will be created.
A ggplot2 object
## Not run:
library(dplyr)
library(ggplot2)
data <- ggplot2::economics_long
data <- data %>%
dplyr::rename(series = variable)
djpr_ts_linechart(data = data)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.