Generate column chart with relative variance (in percents).

column_chart_relative_variance(
  x,
  baseline,
  real,
  colors = 1,
  data = NULL,
  x_title,
  x_style = "previous",
  styles = NULL,
  interval = "months"
)

Arguments

x

vector containing labels for x axis or name of column in data with values of x axis labels

baseline

vector containing base values or name of column in data with base values

real

vector containing values that will be compared to baseline or name of column in data with that values

colors

1 if green color represents positive values having good buisness impact and red negative values having bad impact or 2 if otherwise

data

data frame with columns containing data for x, baseline or real series

x_title

the title of the plot

x_style

style of the x axis to indicate baseline scenario. The default is 'prevoius'.

styles

optional vector with styles of the pin heads

interval

intervals on x axis. The width of the bars depends on this parameter

Value

object of class tidychart with a character vector containing SVG elements

Examples

x <- month.abb baseline <- rnorm(12, mean = 1, sd = 0.2) real <- c(rnorm(6, mean = 0.8, sd = 0.2), rnorm(6, mean = 1.2, sd = 0.2)) column_chart_relative_variance(x, baseline, real, x_title = 'profit %')