This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

PieChart

PieChart
makes a pie chart with sector angle proportional to , , ....
PieChart
makes a pie chart with sector features defined by the symbolic wrappers .
PieChart
makes a pie chart from multiple datasets .
  • Data elements for PieChart can be given in the following forms:
yia pure sector value
wi[yi,...]a sector with value and wrapper
formi->mia sector form with metadata
  • Data not given in these forms is ignored in forming the pie chart.
  • Datasets for PieChart can be given in the following forms:
{e1,e2,...}list of elements with or without wrappers
w[{e1,e2,...},...]wrapper applied to a whole dataset
w[{data1,data1,...},...]wrapper applied to all datasets
  • The following wrappers can be used for chart elements:
Annotation[e,label]provide an annotation
Button[e,action]define an action to execute when the element is clicked
EventHandler[e,...]define a general event handler for the element
Hyperlink[e,uri]make the element act as a hyperlink
Labeled[e,...]display the element with labeling
Legended[e,...]include features of the element in a chart legend
Mouseover[e,over]make the element show a mouseover form
PopupWindow[e,cont]attach a popup window to the element
StatusArea[e,label]display in the status area when the element is moused over
Style[e,opts]show the element using the specified styles
Tooltip[e,label]attach an arbitrary tooltip to the element
"RadialOuter","RadialCenter","RadialInner"positions within sectors
"RadialOutside","RadialInside","RadialEdge"positions outside sectors
"RadialCallout"positions with callout lines
{{s,sr},{lx,ly}}scaled position in the label at scaled polar position in the sector
  • PieChart has the same options as Graphics with the following additions and changes:
ChartBaseStyleAutomaticoverall style for sectors
ChartElementFunctionAutomatichow to generate raw graphics for sectors
ChartLabelsNonelabels for data elements and datasets
ChartLayoutAutomaticoverall layout to use
ChartLegendsNonelegends for data elements and datasets
ChartStyleAutomaticstyle for sector
ColorFunctionAutomatichow to color sectors
ColorFunctionScalingTruewhether to normalize arguments to ColorFunction
LabelingFunctionAutomatichow to label sectors
LegendAppearanceAutomaticoverall appearance of legends
PerformanceGoal$PerformanceGoalaspects of performance to try to optimize
PlotRangeAutomaticrange of values to include
PolarAxesFalsewhether to draw polar axes
PolarAxesOriginAutomaticwhere to draw polar axes
PolarGridLinesNonepolar gridlines to draw
PolarTicksAutomaticpolar axes ticks
SectorOriginAutomaticinitial angle and radius of sectors
SectorSpacingAutomaticspacing between sectors
  • The arguments supplied to ChartElementFunction are the sector region , the values , and the metadata from each level in a nested list of datasets.
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:
Use categorical labels:
Categorical legends:
Set the style for sectors:
Use procedural sectors:
Generate a pie chart for a list of values:
In[1]:=
Click for copyable input
Out[1]=
 
Generate a donut chart for a list of values:
In[1]:=
Click for copyable input
Out[1]=
 
Generate a pie chart for multiple datasets:
In[1]:=
Click for copyable input
Out[1]=
 
Use categorical labels:
In[1]:=
Click for copyable input
Out[1]=
Categorical legends:
In[2]:=
Click for copyable input
Out[2]=
 
Set the style for sectors:
In[1]:=
Click for copyable input
Out[1]=
Use procedural sectors:
In[2]:=
Click for copyable input
Out[2]=
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:
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:
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:
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 PalettesChartElementSchemes:
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:
Provide value labels for sectors by using LabelingFunction:
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:
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:
ColorFunction may override settings for ChartBaseStyle:
Possible string values for ChartElementFunction:
For detailed settings use PalettesChartElementSchemes:
Use 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:
Give a list of ChartElementFunction:
Built-in element functions may have options; use PalettesChartElementSchemes to set them:
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:
Place multiple labels:
ChartLayout is grouped by default in concentric rings:
Use stacked sectors:
The stacked layout can effectively display many datasets:
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:
Use ChartStyle to style sectors:
Give a list of styles:
Use colors from ColorData:
Use 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:
Color by sector angle:
Use ColorFunctionScaling->False to get unscaled height values:
ColorFunction overrides styles in ChartStyle:
Use ColorFunction to combine different style effects:
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:
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:
Control the formatting of labels:
Use the given chart labels as arguments to the labeling function:
Place complete labels as tooltips:
Generate a pie chart with interactive highlighting:
Emphasize performance by disabling interactive behaviors:
Typically less memory is required non-interactive charts:
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 :
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:
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 G8 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:
Get disk space usage of the $InstallationDirectory:
Format data for tooltip placement:
Mouse over the sectors to see the file and directory sizes:
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:
A hue saturation color wheel:
Chartwork:
New in 7