Create stunning pie charts to visualize proportions and percentages. Upload your own data or try our sample datasets.
Try it out!
- Click Sample Data and select Tips Data
- For Label column, select day
- For Value column, select total_bill
- Leave the Facet Column as None or select sex
- Toggle the Pull Out Largest Slice option if you prefer
- Toggle the Donut Chart option if you prefer that style
- Click Generate Pie Chart to visualize the data
Calculator
1. Load Your Data
2. Configure Chart
Related Calculators
Learn More
What is a Pie Chart?
A pie chart is a circular statistical graphic that divides data into slices to illustrate numerical proportions. Each slice represents a category's contribution to the whole dataset, with the entire circle representing 100% of the data. The size of each slice is directly proportional to its percentage of the total, making pie charts ideal for visualizing parts-of-a-whole relationships.
The diagram above illustrates all components of a pie chart. Each slice's angle and area correspond to its proportion of the total, with labels and percentages providing clarity for interpretation.
When to Use Pie Charts
Pie charts are most effective when:
- You need to show proportions or percentages of a whole
- You have a relatively small number of categories (ideally 5-7 or fewer)
- The categories sum to a meaningful total
- You want to emphasize a single category's share of the total
Limitations of Pie Charts
Pie charts have several limitations that can make them less effective for certain types of data:
- Difficult to compare slices that are similar in size
- Become cluttered and hard to read with too many categories
- Not ideal for showing changes over time
- Humans aren't as good at comparing angles as they are at comparing lengths
When dealing with many categories or when precise comparisons are important, consider using a bar chart instead. For temporal data, a line chart is often more appropriate.
Best Practices for Pie Charts
Do's
- ✓Start the largest slice at 12 o'clock
- ✓Order slices from largest to smallest
- ✓Use distinct, contrasting colors
- ✓Include percentage labels for clarity
- ✓Keep categories to 5-7 maximum
- ✓Use "Other" category for small slices
Don'ts
- ✗Don't use 3D effects (they distort perception)
- ✗Don't include too many small slices
- ✗Don't use similar colors for adjacent slices
- ✗Don't omit legends or labels
- ✗Don't use pie charts for time series data
- ✗Don't make comparisons between multiple pies
Creating Pie Charts in R
Here are examples of creating pie charts in R using base R and ggplot2 package.
Basic Pie Chart with Base R
# sample data
categories <- c("Category A", "Category B", "Category C", "Category D")
values <- c(25, 35, 20, 20)
# Basic pie chart
pie(values, labels = categories,
main = "Sample Pie Chart",
col = c("#FF9999", "#66B2FF", "#99FF99", "#FFCC99"))
# Add percentages to labels
percentages <- round(values/sum(values)*100, 1)
labels_with_pct <- paste(categories, "
", percentages, "%", sep="")
pie(values, labels = labels_with_pct,
main = "Pie Chart with Percentages",
col = rainbow(length(values)))
Professional Pie Charts with ggplot2
library(tidyverse)
data <- tibble(
category = c("Category A", "Category B", "Category C", "Category D"),
value = c(25, 35, 20, 20)
)
# calculate percentage and position for labels
data <- data |>
mutate(
percent = round(value / sum(value) * 100, 1),
label = str_glue("{percent}%")
)
ggplot(data, aes(x = "", y = value, fill = category)) +
geom_bar(width = 1, stat = "identity", color = "white") +
coord_polar("y", start = 0) +
geom_text(aes(label = label),
position = position_stack(vjust = 0.5),
color = "white",
size = 5,
fontface = "bold") +
scale_fill_manual(values = c("#FF6F61", "#6B5B95", "#88B04B", "#F7CAC9")) +
labs(title = "Distribution of Categories", fill = "Category") +
theme_void() +
theme(
plot.title = element_text(hjust = 0.5, size = 16, face = "bold"),
legend.title = element_text(size = 12),
legend.text = element_text(size = 10)
)
Creating Pie Charts in Python
Here's how to create pie charts in Python using matplotlib, seaborn, and plotly.
Basic Pie Charts with Matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# sample data
categories = ['Mobile', 'Desktop', 'Tablet', 'Other']
values = [45, 30, 20, 5]
colors = ['#FF9999', '#66B2FF', '#99FF99', '#FFCC99']
plt.figure(figsize=(8, 8))
plt.pie(values, labels=categories, colors=colors, autopct='%1.1f%%', startangle=90)
plt.title('Website Traffic by Device Type', fontsize=16, fontweight='bold')
plt.axis('equal')
plt.show()

Creating Pie Charts in Excel
Excel provides built-in tools for creating pie charts. Here's a step-by-step guide:
Step-by-Step Instructions
Step 1: Prepare Your Data
Organize your data in two columns: categories in the first column and values in the second column.
Mobile | 45
Desktop | 30
Tablet | 20
Other | 5
Step 2: Select Your Data
Highlight both columns including headers (A1:B5 in this example).
Step 3: Insert Pie Chart
- • Go to Insert tab in the ribbon
- • Click on "Charts" group
- • Select "Pie Chart" option
- • Choose from: 2-D Pie, 3-D Pie (not recommended), or Doughnut
Step 4: Customize Your Chart
Add Data Labels:
- • Right-click on pie chart → "Add Data Labels"
- • Choose percentage, values, or category names
- • Format labels using "Format Data Labels" panel
Change Colors:
- • Click on chart → "Chart Styles" on ribbon
- • Or right-click slice → "Format Data Point"
- • Choose colors from Fill options
Pull Out a Slice:
- • Click once on entire pie, then click specific slice
- • Drag the slice outward to "explode" it
- • Or use Format Data Point → Series Options
Step 5: Add Titles and Polish
- • Click chart → "Chart Elements" (+) → "Chart Title"
- • Add legend if needed
- • Adjust chart size by dragging corners
- • Use "Chart Styles" for quick professional themes