% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/percent_bar.R
\name{pie_chart}
\alias{pie_chart}
\title{Create Pie or Donut Charts}
\usage{
pie_chart(
  input,
  var,
  var2 = NULL,
  type = 2,
  show_freq = FALSE,
  color = NULL,
  palette = "jama",
  title = NULL,
  text_size = 10,
  title_size = 20,
  add_sum = FALSE
)
}
\arguments{
\item{input}{Input dataframe.}

\item{var}{Variable for the chart.}

\item{var2}{Secondary variable for donut chart (type = 3).}

\item{type}{Chart type: 1 (pie), 2 (donut), 3 (PieDonut via webr).}

\item{show_freq}{Logical to show frequencies. Default is FALSE.}

\item{color}{Optional color palette.}

\item{palette}{Color palette name. Default is "jama".}

\item{title}{Plot title. Default is NULL.}

\item{text_size}{Text size. Default is 10.}

\item{title_size}{Title size. Default is 20.}

\item{add_sum}{Logical to add sum to labels. Default is FALSE.}
}
\value{
A ggplot object.
}
\description{
Generates a pie chart or donut chart from input data.
}
\examples{
sig_stad <- load_data("sig_stad")
pie_chart(input = sig_stad, var = "Subtype", palette = "jama")
pie_chart(input = sig_stad, var = "Subtype", type = 2)
}
\author{
Dongqiang Zeng
}
