PieChart

PieChart[{y1,y2,,yn}]

makes a pie chart with sector angle proportional to y1, y2, .

PieChart[{,wi[yi,],,wj[yj,],}]

makes a pie chart with sector features defined by the symbolic wrappers wk.

PieChart[{data1,data2,}]

makes a pie chart from multiple datasets datai.

Details and Options

Examples

open allclose all

Basic Examples  (5)

Generate a pie chart for a list of values:

Generate a donut chart for a list of values:

Generate a pie chart for multiple datasets:

Show multiple sets as a row of pie charts:

Use categorical labels:

Categorical legends:

Set the style for sectors:

Scope  (37)

Data and Layouts  (13)

Items in a dataset are grouped together:

Datasets do not need to have the same number of items:

Nonreal data is taken to be missing and typically is ignored in the pie chart:

The data may include units:

Specify the units to use:

The time stamps in TimeSeries, EventSeries, and TemporalData are ignored:

The values in associations are taken as the values of the sectors:

Use the keys as labels:

Use the keys as callouts above the sectors:

Use the keys as legends:

Associations can be nested:

The weights in WeightedData are ignored:

The censoring and truncation information in EventData is ignored:

Use different layouts to display multiple datasets:

Control the direction of sectors:

Control the starting angle of sectors:

Control the starting radius of sectors:

Adjust the spacing between sectors and groups of sectors:

Wrappers  (5)

Use wrappers on individual data, datasets, or collections of datasets:

Wrappers can be nested:

Override the default tooltips:

Use any object in the tooltip:

Use PopupWindow to provide additional drilldown information:

Button can be used to trigger any action:

Styling and Appearance  (7)

Use an explicit list of styles for the sectors:

Use any gradient or indexed color schemes from ColorData:

Use color schemes designed for charting:

ChartBaseStyle can be used to set an initial style for all chart elements:

Style can be used to override styles:

Use built-in programmatically generated sectors:

For detailed settings use Palettes ChartElementSchemes:

Use a theme with a high-contrast color scheme and bezel sectors:

Use a monochrome theme:

Labeling and Legending  (12)

Use Labeled to add a label to a sector:

Use symbolic positions for label placement:

Provide categorical labels for the columns of data:

For rows of data:

For both:

Use Placed to control the positioning of labels, using the same positions as for Labeled:

Use Callout to add a label to a sector:

Change the appearance of the callout:

Automatically position callouts:

Provide value labels for sectors by using LabelingFunction:

Generate callouts from the data:

Add categorical legend entries for the columns of data:

For rows of data:

Use Legended to add additional legend entries:

Use Placed to affect the positioning of legends:

Options  (75)

ChartBaseStyle  (5)

Use ChartBaseStyle to style sectors:

ChartBaseStyle combines with ChartStyle:

ChartStyle may override settings for ChartBaseStyle:

ChartBaseStyle combines with Style:

Style may override settings for ChartBaseStyle:

ChartBaseStyle combines with ColorFunction:

ColorFunction may override settings for ChartBaseStyle:

ChartElementFunction  (6)

Possible string values for ChartElementFunction:

For detailed settings, use Palettes ChartElementSchemes:

Use ChartElementData to specify the full chart element rendering function:

Write a custom ChartElementFunction:

Use metadata passed on from the input, in this case charting the data:

Built-in element functions may have options; use Palettes ChartElementSchemes to set them:

ChartLabels  (8)

By default, labels are placed radially centered:

Labeled wrappers in data will place additional labels:

Use Placed to control label placement:

Positions outside the sector:

Callout positions:

Coordinate based placement relative to a sector:

Place all labels at the first outer corner and vary the coordinates within the label:

Use the third argument to Placed to control formatting:

Use a hyperlink label:

By default, labels are associated with columns of data:

Associate labels with rows or datasets:

Label both rows and columns:

Use Placed to affect placements:

Use Callout to connect the labels to the sectors:

Place multiple labels:

ChartLayout  (4)

ChartLayout is grouped by default in concentric rings:

Use stacked sectors:

The stacked layout can effectively display many datasets:

Place each set in a separate panel:

Use a row instead of a column:

Use multiple columns or rows:

Prefer full columns or rows:

ChartLegends  (8)

Generate a legend based on chart style:

Use Legended to add additional legend entries:

Use Legended to specify individual legend entries:

Legended adds additional legend entries:

Generate a legend for datasets:

Unused legend labels are dropped:

Legends can be applied to several dimensions:

Use Placed to control the placement of legends:

ChartStyle  (7)

Use ChartStyle to style sectors:

Give a list of styles:

Use gradient colors from ColorData:

Use indexed colors from ColorData:

Use indexed colors optimized for charting:

Styles are used cyclically:

Style each column of data:

Style each row of data:

Style both rows and columns of data:

With both row and column styles, the last style may override earlier ones:

Style overrides settings for ChartStyle:

ColorFunction overrides settings for ChartStyle:

ColorFunction  (3)

Color by sector angle:

Use ColorFunctionScaling->False to get unscaled height values:

ColorFunction overrides styles in ChartStyle:

Use ColorFunction to combine different style effects:

ColorFunctionScaling  (3)

By default, scaled height values are used:

Set ColorFunctionScaling to False to allow raw values to be passed to the color function:

Use ColorFunctionScaling->False to get unscaled height values:

ImageSize  (7)

Use named sizes, such as Tiny, Small, Medium and Large:

Specify the width of the plot:

Specify the height of the plot:

Allow the width and height to be up to a certain size:

Specify the width and height for a graphic, padding with space if necessary:

Use maximum sizes for the width and height:

Use ImageSizeFull to fill the available space in an object:

Specify the image size as a fraction of the available space:

LabelingFunction  (7)

Use automatic labeling by values through Tooltip and StatusArea:

Do no labeling:

Use Placed to control label placement:

Positions outside the sector:

Callout positions:

Coordinate-based placement relative to a sector:

Use Callout to place labels automatically:

Control the formatting of labels:

Use the given chart labels as arguments to the labeling function:

Place complete labels as tooltips:

LabelingSize  (4)

Textual labels are shown at their actual sizes:

Image labels are automatically resized:

Specify a maximum size for textual labels:

Specify a maximum size for image labels:

Show image labels at their natural sizes:

PerformanceGoal  (3)

Generate a pie chart with interactive highlighting:

Emphasize performance by disabling interactive behaviors:

Typically, less memory is required for noninteractive charts:

PlotTheme  (1)

Use a theme with a high-contrast color scheme and bezel sectors:

Change the chart element function:

SectorOrigin  (4)

By default, sectors start on the left and add clockwise:

Generate a donut chart for a list of values:

Reverse the direction of the sectors:

Rotate the chart by :

SectorSpacing  (5)

Use automatically determined spacing between sectors:

Use no spacing:

Use symbolic presets:

Use explicit spacing between sectors:

Use explicit spacing between sectors and groups of sectors:

Applications  (15)

Create a circular histogram:

Improve legibility of small segments by charting them with an auxiliary pie chart:

Improve legibility of small segments by charting them with an auxiliary bar chart:

Use a stacked bar chart to represent small segments:

Click on the sectors to hear the name of the country and its GDP per capita:

Proportion of each color in the United States flag:

Tally the most frequently used colors:

Chart it:

GDP comparison of G7 nations:

Percentage of total elements discovered by countries:

Count the number of times each letter occurs in a sentence:

Group sectors by product type:

Create a pie chart capable of interactive drilling down of a stock portfolio:

Mouse over a sector to get a pie chart of the companies that comprise that sector:

Click on a sector to get a pie chart of the companies that comprise that sector:

Display oil data for the G15 countries using pie charts to indicate import and export:

Create a chart of individual pie chart sectors:

Create a pie chart histogram of element discovery years from 1700 to 2000:

Define a chart element function that stores bin intervals and count data using Sow:

Create a histogram of the discovery years and store the bin interval and frequencies:

Create a histogram pie chart of element discovery years:

Visualize chemical composition using pie charts:

Analyze locations of strong earthquakes:

Define continents and oceans:

Count the number of earthquakes per region:

Select regions with earthquakes:

Properties & Relations  (4)

Use PieChart3D to get a 3D rendering of pie charts:

PieChart is a special case of SectorChart:

Use BarChart and BarChart3D to draw a list of data as bars:

Use ListPlot and ListLinePlot to produce line graphs:

Neat Examples  (3)

A hue saturation color wheel:

Chartwork:

Wolfram Research (2008), PieChart, Wolfram Language function, https://reference.wolfram.com/language/ref/PieChart.html (updated 2021).

Text

Wolfram Research (2008), PieChart, Wolfram Language function, https://reference.wolfram.com/language/ref/PieChart.html (updated 2021).

CMS

Wolfram Language. 2008. "PieChart." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/PieChart.html.

APA

Wolfram Language. (2008). PieChart. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PieChart.html

BibTeX

@misc{reference.wolfram_2024_piechart, author="Wolfram Research", title="{PieChart}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/PieChart.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_piechart, organization={Wolfram Research}, title={PieChart}, year={2021}, url={https://reference.wolfram.com/language/ref/PieChart.html}, note=[Accessed: 21-November-2024 ]}