
Image by Author | ChatGPT
Enhanced donut charts elevate simple pie charts by adding visual depth and clarity through hollow centers, making proportional relationships easier to interpret while providing space for additional context or summary statistics.
A donut chart displays proportional data as segments of a circle with a hollow center, offering a cleaner alternative to traditional pie charts. This visualization technique helps you communicate part-to-whole relationships while reducing visual clutter and providing space for additional information like totals or key metrics in the center area.
Plotly excels at creating interactive donut charts that go far beyond static alternatives available in matplotlib or seaborn. While other libraries require complex workarounds to create donut charts with interactive features, Plotly makes it straightforward with built-in parameters for hover details, click interactions, and smooth animations. This focus on web-native visualizations means your donut charts work seamlessly in presentations, dashboards, and reports without requiring additional software.
Applications of Enhanced Donut Charts
Enhanced donut charts are particularly effective for:
- Displaying market share, budget allocations, or demographic breakdowns
- Comparing category proportions when you have 3-7 distinct groups
- Adding contextual information in the center space without cluttering the visualization
- Creating interactive dashboards where users can explore data by clicking segments
- Presenting survey results or voting patterns with clear percentage breakdowns
Creating Your First Enhanced Donut Chart
Let’s create an enhanced donut chart using sample market share data. This example will demonstrate how to transform basic categorical data into an engaging, interactive visualization.
import plotly.express as px
import pandas as pd
# Create sample market share data
data = {'Company': ['Apple', 'Samsung', 'Google', 'OnePlus', 'Others'],
'Market_Share': [35, 28, 15, 12, 10]}
df = pd.DataFrame(data)
This creates our sample dataset showing smartphone market share percentages.
# Create the enhanced donut chart
fig = px.pie(df, values='Market_Share', names='Company',
title='Smartphone Market Share 2024',
hole=0.4) # Creates the donut hole
fig.write_html("donut_chart.html")
The hole=0.4 parameter creates the characteristic donut appearance by removing 40% of the center area.

Understanding the Visualization
The resulting chart reveals several insights about market dynamics:
Proportion Clarity: The donut format makes it easier to compare segment sizes compared to traditional pie charts. The hollow center reduces the visual weight of the chart, allowing viewers to focus on the outer segments where the actual data comparison occurs.
Market Leaders: Apple and Samsung together control over 60% of the market, shown by their dominant segment sizes. This type of insight becomes immediately apparent through the visual proportions.
Interactive Features: Hovering over segments reveals exact percentages and values, while clicking segments can highlight or filter specific categories for detailed analysis.
Customizing Your Donut Chart
You can enhance the visualization with additional formatting and styling options:
# Enhanced donut chart with custom styling
fig = px.pie(df, values='Market_Share', names='Company',
title='Smartphone Market Share 2024',
hole=0.5, color_discrete_sequence=px.colors.qualitative.Set3)
fig.update_traces(textposition='inside', textinfo='percent+label')
fig.update_layout(font_size=12, title_x=0.5)
# Add center annotation for context
fig.add_annotation(x=0.5, y=0.5, text="Total<br>Market<br>100%",
showarrow=False, font_size=16, font_color="black")
fig.write_html("enhanced_donut_chart.html")
This version increases the hole size to 50% and adds percentage labels directly on each segment. The center annotation utilizes the hollow space to provide additional context. The x=0.5, y=0.5 coordinates position the text at the exact center of the chart.

Interactive Features and Controls
Enhanced donut charts in Plotly include several interactive elements:
- Hover Information: Display detailed values, percentages, and custom data when hovering over segments
- Click Selection: Highlight specific segments or trigger filtering actions
- Legend Interaction: Toggle segments on and off by clicking legend items
- Smooth Animations: Animated transitions when data updates or segments change
Best Practices for Donut Charts
Limit Categories: Keep segments between 3-7 for optimal readability. Too many small segments become difficult to distinguish and interpret.
Meaningful Colors: Use colors that relate to your data context. Brand colors for companies, intuitive colors for categories (red for negative, green for positive).
Clear Labels: Ensure segment labels are readable and provide sufficient context. Include percentages when exact proportions matter.
Center Space Utilization: Use the hollow center for totals, key metrics, or explanatory text rather than leaving it empty.
Common Design Considerations
Segment Ordering: Arrange segments logically, typically from largest to smallest or following a natural sequence like chronological order.
Color Accessibility: Choose colors that remain distinguishable for colorblind users and maintain sufficient contrast.
Proportional Accuracy: Ensure your data genuinely represents parts of a whole that sum to 100%. Donut charts work poorly for independent categories.
Mobile Responsiveness: Test how your donut charts display on different screen sizes, especially for dashboard implementations.
Conclusion
Enhanced donut charts provide an excellent way to visualize proportional data with improved clarity and interactive capabilities. The smartphone market share example demonstrates how this technique can effectively communicate competitive landscapes and market dynamics.
The combination of visual appeal, interactive features, and the ability to add contextual information in the center space makes enhanced donut charts particularly valuable for business presentations and data dashboards. When designed thoughtfully with appropriate colors, clear labels, and meaningful data groupings, they transform simple categorical data into engaging, informative visualizations that facilitate better decision-making.
