% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/create_line_asis.R
\name{create_line_asis}
\alias{create_line_asis}
\title{Create a line chart without aggregation for any metric}
\usage{
create_line_asis(
  data,
  date_var = "MetricDate",
  metric,
  title = NULL,
  subtitle = NULL,
  caption = NULL,
  ylab = date_var,
  xlab = metric,
  line_colour = rgb2hex(0, 120, 212),
  label = FALSE
)
}
\arguments{
\item{data}{Plotting data as a data frame.}

\item{date_var}{String containing name of variable for the horizontal axis.}

\item{metric}{String containing name of variable representing the line.}

\item{title}{Title of the plot.}

\item{subtitle}{Subtitle of the plot.}

\item{caption}{Caption of the plot.}

\item{ylab}{Y-axis label for the plot (group axis)}

\item{xlab}{X-axis label of the plot (bar axis).}

\item{line_colour}{String to specify colour to use for the line.
Hex codes are accepted. You can also supply
RGB values via \code{rgb2hex()}.}

\item{label}{Logical value to determine whether to show data point labels on
the plot. If \code{TRUE}, both \code{geom_point()} and \code{geom_text()} are added to
display data labels rounded to 1 decimal place above each data point.
Defaults to \code{FALSE}.}
}
\value{
Returns a 'ggplot' object representing a line plot.
}
\description{
This function creates a line chart directly from the aggregated / summarised data.
Unlike \code{create_line()} which performs a person-level aggregation, there is no
calculation for \code{create_line_asis()} and the values are rendered as they are passed
into the function. The only requirement is that a \code{date_var} is provided for the x-axis.
}
\examples{
library(dplyr)

# Median `Emails_sent` grouped by `MetricDate`
# Without Person Averaging
med_df <-
  pq_data \%>\%
  group_by(MetricDate) \%>\%
  summarise(Emails_sent_median = median(Emails_sent))

med_df \%>\%
  create_line_asis(
    date_var = "MetricDate",
    metric = "Emails_sent_median",
    title = "Median Emails Sent",
    subtitle = "Person Averaging Not Applied",
    caption = extract_date_range(pq_data, return = "text")
  )

# Create line plot with data point labels
med_df \%>\%
  create_line_asis(
    date_var = "MetricDate",
    metric = "Emails_sent_median",
    title = "Median Emails Sent",
    subtitle = "Person Averaging Not Applied",
    caption = extract_date_range(pq_data, return = "text"),
    label = TRUE
  )

}
\seealso{
Other Visualization: 
\code{\link{afterhours_dist}()},
\code{\link{afterhours_fizz}()},
\code{\link{afterhours_line}()},
\code{\link{afterhours_rank}()},
\code{\link{afterhours_summary}()},
\code{\link{afterhours_trend}()},
\code{\link{collaboration_area}()},
\code{\link{collaboration_dist}()},
\code{\link{collaboration_fizz}()},
\code{\link{collaboration_line}()},
\code{\link{collaboration_rank}()},
\code{\link{collaboration_sum}()},
\code{\link{collaboration_trend}()},
\code{\link{create_bar}()},
\code{\link{create_bar_asis}()},
\code{\link{create_boxplot}()},
\code{\link{create_bubble}()},
\code{\link{create_dist}()},
\code{\link{create_fizz}()},
\code{\link{create_inc}()},
\code{\link{create_line}()},
\code{\link{create_period_scatter}()},
\code{\link{create_rank}()},
\code{\link{create_rogers}()},
\code{\link{create_sankey}()},
\code{\link{create_scatter}()},
\code{\link{create_stacked}()},
\code{\link{create_tracking}()},
\code{\link{create_trend}()},
\code{\link{email_dist}()},
\code{\link{email_fizz}()},
\code{\link{email_line}()},
\code{\link{email_rank}()},
\code{\link{email_summary}()},
\code{\link{email_trend}()},
\code{\link{external_dist}()},
\code{\link{external_fizz}()},
\code{\link{external_line}()},
\code{\link{external_rank}()},
\code{\link{external_sum}()},
\code{\link{hr_trend}()},
\code{\link{hrvar_count}()},
\code{\link{hrvar_trend}()},
\code{\link{keymetrics_scan}()},
\code{\link{meeting_dist}()},
\code{\link{meeting_fizz}()},
\code{\link{meeting_line}()},
\code{\link{meeting_rank}()},
\code{\link{meeting_summary}()},
\code{\link{meeting_trend}()},
\code{\link{one2one_dist}()},
\code{\link{one2one_fizz}()},
\code{\link{one2one_freq}()},
\code{\link{one2one_line}()},
\code{\link{one2one_rank}()},
\code{\link{one2one_sum}()},
\code{\link{one2one_trend}()}

Other Flexible: 
\code{\link{create_bar}()},
\code{\link{create_bar_asis}()},
\code{\link{create_boxplot}()},
\code{\link{create_bubble}()},
\code{\link{create_density}()},
\code{\link{create_dist}()},
\code{\link{create_fizz}()},
\code{\link{create_hist}()},
\code{\link{create_inc}()},
\code{\link{create_line}()},
\code{\link{create_period_scatter}()},
\code{\link{create_rank}()},
\code{\link{create_sankey}()},
\code{\link{create_scatter}()},
\code{\link{create_stacked}()},
\code{\link{create_tracking}()},
\code{\link{create_trend}()}

Other Time-series: 
\code{\link{create_line}()},
\code{\link{create_period_scatter}()},
\code{\link{create_trend}()}
}
\concept{Flexible}
\concept{Time-series}
\concept{Visualization}
