Overview
Pie charts represent data as slices of a circular pie, where each slice’s size is proportional to its value. They’re ideal for showing part-to-whole relationships and percentage distributions. TeeChart supports various pie chart styles including 3D pies, exploded slices, semi-circles, and donut charts. Use cases:- Showing part-to-whole relationships
- Displaying percentage distributions
- Comparing proportions of a total
- Simple categorical data visualization (limited categories)
Series Classes
TPieSeries - Standard pie charts TDonutSeries - Pie charts with hollow centerKey Properties
| Property | Type | Description |
|---|---|---|
ExplodeBiggest | Integer | Pixels to explode largest slice |
Explode | Array | Explode individual slices |
AngleSize | Integer | Total angle (360 for full circle, 180 for semi-circle) |
RotationAngle | Integer | Starting angle rotation (0-360) |
Circled | Boolean | Draw circle around pie |
Dark3D | Boolean | Apply 3D shading effect |
EdgeStyle | TPieEdgeStyle | Edge appearance: edFlat, edCurved |
Gradient | TChartGradient | Configure gradient fills |
Shadow | TShadow | Shadow effect settings |
Marks | TSeriesMarks | Configure slice labels |
OtherSlice | TPieOtherSlice | Group small slices together |
Code Examples
Basic Pie Chart
From VCL/TeeNew/SeriesType_Pie.pas:88:Exploded Pie Slices
From VCL/TeeNew/SeriesType_Pie.pas:78:Semi-Circle Pie Chart
From VCL/TeeNew/SeriesType_Pie.pas:47:Pie Chart with Shadow
From VCL/TeeNew/SeriesType_Pie.pas:58:3D Pie Chart
From VCL/TeeNew/SeriesType_Pie.pas:84:Pie Chart with Gradient
From VCL/TeeNew/Pie_Gradient.pas:34:Donut Chart
Multiple Pie Charts
From VCL/TeeNew/Pie_Multi.pas (example pattern):Customization Options
Slice Colors
Marks and Labels
Mark Position
From VCL/TeeNew/Pie_AutoMarkPosition.pas (example pattern):Rotation
Other Slice (Group Small Values)
From VCL/TeeNew/Pie_OtherLegend.pas (example pattern):Lighting Effect
From VCL/TeeNew/Pie_Lighting.pas (example pattern):Advanced Features
Frame and Border
From VCL/TeeNew/Pie_FrameBorder.pas (example pattern):Slice Heights (3D)
From VCL/TeeNew/Pie_SliceHeights.pas (example pattern):Custom Positioning
Click Detection
Best Practices
- Limit number of slices - Too many slices make the chart hard to read (5-7 slices recommended)
- Use OtherSlice - Group small values into an “Other” category
- Order slices - Arrange from largest to smallest for clarity
- Avoid 3D when precision matters - 3D can distort perception of sizes
- Use clear labels - Ensure marks don’t overlap
Related Chart Types
- Donut Charts - Pie with hollow center
- Bar Charts - Better for comparing many categories
- Area Charts - Show trends over time instead of proportions
- Gauge Charts - Display single value as percentage
