bar_chart_relative_variance: Generate bar chart with relative variance (in percents).

Description Usage Arguments Value Examples

View source: R/bar_chart.R

Description

Generate bar chart with relative variance (in percents).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
bar_chart_relative_variance(
  data = NULL,
  cat,
  baseline,
  real,
  colors = 1,
  y_title,
  y_style = "previous",
  styles = NULL
)

Arguments

data

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

cat

vector containing category names of values

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 business impact and red negative values having bad impact or 2 if otherwise

y_title

title of the series values

y_style

style of y axis to indicate baseline scenario

styles

optional vector with styles of the pin heads

Value

object of class tidychart with a character vector containing SVG elements

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# get some data
real <- sin(1:5)
baseline <- cos(1:5)
cat <- letters[1:5]

bar_chart_relative_variance(
  cat = cat,
  baseline = baseline,
  real = real,
  y_title = 'a title')

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