Skip to contents

# Simple bar chart

Source: `R/lollipop.R`
`lollipop.Rd`

Simple bar chart

## Usage

    lollipop(
      df,
      x,
      y,
      flip = TRUE,
      wrap = NULL,
      arrange = TRUE,
      point_size = 3,
      point_color = cols_reach("main_red"),
      point_alpha = 1,
      segment_size = 1,
      segment_color = cols_reach("main_grey"),
      segment_alpha = 1,
      alpha = 1,
      x_title = NULL,
      y_title = NULL,
      title = NULL,
      subtitle = NULL,
      caption = NULL,
      add_text = FALSE,
      add_text_size = 3,
      add_text_suffix = "",
      add_text_color = "white",
      add_text_fontface = "bold",
      theme = theme_reach()
    )

## Arguments

df

  A data frame.

x

  A numeric column.

y

  A character column or coercible as a character column.

flip

  TRUE or FALSE. Default to TRUE or horizontal lollipop plot.

wrap

  Should x-labels be wrapped? Number of characters.

arrange

  TRUE or FALSE. Arrange by highest percentage first.

point_size

  Point size.

point_color

  Point color.

point_alpha

  Point alpha.

segment_size

  Segment size.

segment_color

  Segment color.

segment_alpha

  Segment alpha.

alpha

  Fill transparency.

x_title

  The x scale title. Default to NULL.

y_title

  The y scale title. Default to NULL.

title

  Plot title. Default to NULL.

subtitle

  Plot subtitle. Default to NULL.

caption

  Plot caption. Default to NULL.

add_text

  TRUE or FALSE. Add the y value as text within the bubble.

add_text_size

  Text size.

add_text_suffix

  If percent is FALSE, should we add a suffix to the text label?

add_text_color

  Added text color. Default to white.

add_text_fontface

  Added text font face. Default to "bold".

theme

  Whatever theme. Default to theme_reach().

## Value

A bar chart