% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ggpie.R
\name{ggpie}
\alias{ggpie}
\title{Create a Pie Chart with ggplot2}
\usage{
ggpie(
  df,
  .x,
  .y,
  .offset = 1,
  .color = "white",
  .legend = FALSE,
  .label = TRUE,
  .label_size = 3.5
)
}
\arguments{
\item{df}{A data frame.}

\item{.x}{Column name (string) of the categorical variable used
for the slices.}

\item{.y}{Column name (string) of the numeric variable used for
the slice values.}

\item{.offset}{Numeric scalar (> 0). Controls label position
along the slice radius. Default \code{1} places the label at the
middle of the slice. Smaller values (e.g. \code{0.5}) move the
label inward toward the centre; larger values (e.g. \code{2})
move it outward toward the edge or beyond, useful for
donut-style layouts.}

\item{.color}{Border color between slices. Default \code{"white"}.}

\item{.legend}{Logical. Show the legend? Default \code{FALSE}.}

\item{.label}{Logical. Draw \code{"name\\n(pct\%)"} labels on the
slices? Default \code{TRUE}.}

\item{.label_size}{Label text size in mm. Default \code{3.5}.}
}
\value{
A \code{ggplot} object.
}
\description{
Builds a pie chart from a data frame using one categorical column
and one numeric column. Slices are labeled with the category
name and percentage share.
}
\examples{
df <- data.frame(
  category = c("A", "B", "C"),
  value = c(40, 35, 25)
)
ggpie(df, "category", "value")
}
