Skip to contents

Simple horizontal bar chart

Usage

hbar(
  .tbl,
  x,
  y,
  group = NULL,
  initiative = "reach",
  pal = "primary",
  width = 0.5,
  x_title = "",
  y_title = "",
  group_title = NULL,
  font_family = "Leelawadee",
  scales_percent = TRUE,
  position = "dodge",
  reverse = FALSE,
  title = "",
  subtitle = "",
  ...
)

Arguments

.tbl

Some data

x

Some numeric column on the x scale

y

Some column on the y scale

group

Some grouping categorical column, e.g. administrative areas

initiative

Either "reach" or "agora" or "impact" for the color palette

pal

The color palette from the initiative

width

Width.

x_title

The x scale title. Default to empty string

y_title

The y scale title. Default to empty string

group_title

The group legend title. Defaut to NULL

font_family

The font family. Default to "Leelawadee"

scales_percent

Should x_labels be scaled to percentages? Default to TRUE.

position

Should the chart be stacked? Default to dodge

reverse

Boolean indicating whether the color palette should be reversed

title

Plot title. Default to empty string

subtitle

Plot subtitle. Default to empty string

...

Other arguments to be passed to "ggblanket::gg_col"

Value

A horizontal bar chart