View Live Example
See pie charts in action with interactive examples
Overview
Pie charts are perfect for displaying proportional data and percentages. Cristalyse supports both traditional pie charts and donut charts with smooth animations, customizable styling, and interactive features.Basic Pie Chart
Create a simple pie chart to show proportions:Donut Chart
Create a donut chart with a hollow center:Exploded Pie Chart
Create separation between slices for emphasis:Styling Options
Custom Colors
Override default color mapping:Stroke Styling
Add borders to pie slices:Custom Label Styling
Customize label appearance:Animation Options
Progressive Slice Animation
Slices animate in sequence:Custom Start Angle
Control where the pie starts:Label Formatting
Transform pie chart labels by passing a callback to thelabels
parameter.
Simple Custom Labels
For basic formatting, you can use a simple callback:Using NumberFormat
For robust, locale-aware formatting, use NumberFormat:Percentage Formatting
WhenshowPercentages: true
, your callback receives ratio values (0.0-1.0):
Real-World Examples
E-commerce Sales by Category
Project Time Allocation
Advanced Features
Interactive Pie Charts
Add hover effects and click handling:Responsive Sizing
Automatically adjust based on container size:Best Practices
When to Use Pie Charts
Good for:- Showing parts of a whole
- Displaying percentages
- Comparing proportions (5-7 categories max)
- Simple data visualization
- Too many categories (>7)
- Comparing exact values
- Time series data
- Negative values
Design Tips
- Limit to 5-7 slices for readability
- Use contrasting colors
- Order slices by size (largest first)
- Consider donut charts for modern look
- Use exploded slices sparingly for emphasis
Performance Considerations
- Optimize for large datasets by grouping small values
- Use appropriate animation durations
- Consider static rendering for print/export
- Test on different screen sizes