dplot3_pie: Interactive Pie Chart

View source: R/dplot3_pie.R

dplot3_pieR Documentation

Interactive Pie Chart

Description

Draw interactive pie charts using plotly

Usage

dplot3_pie(
  x,
  main = NULL,
  xlab = NULL,
  ylab = NULL,
  col = NULL,
  alpha = 0.8,
  bg = NULL,
  plot.bg = NULL,
  theme = getOption("rt.theme", "black"),
  palette = rtPalette,
  category.names = NULL,
  textinfo = "label+percent",
  font.size = 16,
  labs.col = NULL,
  legend = TRUE,
  legend.col = NULL,
  sep.col = NULL,
  margin = list(b = 50, l = 50, t = 50, r = 20),
  padding = 0,
  displayModeBar = TRUE,
  modeBar.file.format = "svg",
  filename = NULL,
  file.width = 500,
  file.height = 500,
  file.scale = 1,
  ...
)

Arguments

x

data.frame: Input: Either a) 1 numeric column with categories defined by rownames, or b) two columns, the first is category names, the second numeric or c) a numeric vector with categories defined using the category.names argument

main

Character: Plot title. Default = NULL, which results in colnames(x)[1],

xlab

Character: x-axis label.

ylab

Character: y-axis label.

col

Color, vector: Color for bars. Default NULL, which will draw colors from palette

alpha

Float (0, 1]: Transparency for bar colors. Default = .8

bg

Background color

plot.bg

Plot background color

theme

Character: "light", "dark". Default = getOption("rt.theme", "light")

palette

Character: Name of rtemis palette to use. Default = "rtCol1". Only used if col = NULL

category.names

Character, vector, length = NROW(x): Category names. Default = NULL, which uses either rownames(x), or the first column of x if ncol(x) = 2

textinfo

Character: Info to show over each slince: "label", "percent", "label+percent" Default = "label+percent"

font.size

Float: Font size for all labels. Default = 16

labs.col

Color of labels

legend

Logical: If TRUE, draw legend. Default = NULL, and will be turned on if there is more than one feature present

legend.col

Color: Legend text color. Default = NULL, determined by theme

sep.col

Separator color

margin

Named list: plot margins.

padding

Integer: N pixels to pad plot.

displayModeBar

Logical: If TRUE, show plotly's modebar

modeBar.file.format

Character: "svg", "png", "jpeg", "pdf" / any output file type supported by plotly and your system

filename

Character: Path to file to save static plot. Default = NULL

file.width

Integer: File width in pixels for when filename is set.

file.height

Integer: File height in pixels for when filename is set.

file.scale

Numeric: If saving to file, scale plot by this number

...

Additional arguments passed to theme

Author(s)

E.D. Gennatas

Examples

## Not run: 
dplot3_pie(VADeaths[, 1, drop = F])

## End(Not run)

egenn/rtemis documentation built on Oct. 28, 2024, 6:30 a.m.