Visualizing proportional data effectively often calls for a 3‑D exploded pie chart. In many business reports, this chart type highlights individual segments while adding a three‑dimensional look that draws the reader’s attention. This article demonstrates how to generate a Pie3DExploded chart in Excel using C# and Aspose.Cells for .NET. With just a few lines of code you can create, style, and export the chart to any supported format (XLSX, PDF, PNG, etc.).
The article is organized as follows:
- C# Excel Library to Create Pie3DExploded Chart
- Create a Pie3DExploded Chart in Excel using C#
- Free Resources
- Conclusion
- See Also
C# Excel Library to Create Pie3DExploded Chart
Aspose.Cells for .NET is a powerful, fully managed Excel library that enables developers to create, modify, and render Excel files without the need for Microsoft Office. Its rich API makes chart automation straightforward, including advanced 3‑D chart types and exploded pie functionality.
Key advantages of using Aspose.Cells for chart creation:
- Full .NET support – Works with .NET Framework, .NET Core, and .NET 6/7/8.
- No Office required – Operates on server‑side environments where Office is unavailable.
- Rich charting capabilities – Supports more than 50 chart types, including 3‑D and exploded variants.
- High performance – Handles large datasets with low memory footprint.
- Multiple export formats – Save to XLSX, PDF, HTML, PNG, JPEG, SVG, and more.
Getting Started
Download the latest Aspose.Cells for .NET from the official releases page.
Install the NuGet package:
PM> Install-Package Aspose.CellsAdd a reference to
Aspose.Cellsin your C# project.
Now you’re ready to create a Pie3DExploded chart.
Create a Pie3DExploded Chart in Excel using C#
Below are two complete, runnable examples:
- Basic Pie3DExploded chart – Shows how to create the chart and explode the whole series.
- Customized Pie3DExploded chart – Demonstrates styling, exploding specific slices, and exporting to PNG.
Example 1 – Basic Pie3DExploded Chart
Explanation of key steps
| Step | Code | Purpose |
|---|---|---|
| 1 | new Workbook() | Creates an in‑memory Excel workbook. |
| 2 | sheet.Cells["A1"].Value = "Category" | Fills the worksheet with category/value pairs. |
| 3 | sheet.Charts.Add(ChartType.Pie3D, …) | Adds a 3‑D pie chart to the sheet. |
| 4 | chart.NSeries.Add("=Sheet1!$B$2:$B$5", true) | Binds the series to the data range. |
| 5 | chart.NSeries[seriesIndex].Explosion = 15 | Increases the distance between slices for a more pronounced effect. |
| 6 | workbook.Save(...) | Writes the workbook to an XLSX file. |
Running the program produces Pie3DExploded_Basic.xlsx with a clean 3‑D exploded pie chart.
Example 2 – Customized Pie3DExploded Chart (Styling & Export)
What this example adds
- Selective explosion – Only the “Bikes” slice is separated using
ExplodePoints. - Custom slice colors – Directly accesses each point’s
Area.ForegroundColor. - Data labels – Shows category name and value inside each slice.
- High‑resolution export – Saves the chart as a 300 dpi PNG image (
ToImagemethod).
Both examples compile with .NET 6+ and require only the Aspose.Cells NuGet package.
Get a Free License
Want to experiment without purchasing a full license? Visit the Aspose temporary license page to obtain a free 30‑day evaluation license. This will unlock all features, including chart creation, so you can test the code above without restrictions.
Free Resources
- Developer’s Guide – https://docs.aspose.com/cells/net/
- Online Demo & Converter – https://products.aspose.app/cells/family
- API Reference – https://reference.aspose.com/cells/net/
- How‑to Articles – https://blog.aspose.com/categories/aspose.cells-product-family/
Conclusion
Creating a 3‑D exploded pie chart in Excel is straightforward with Aspose.Cells for .NET. The library provides granular control over chart type, explosion settings, colors, data labels, and export formats. By following the examples above you can integrate eye‑catching pie charts into any automated reporting solution, whether you’re building a financial dashboard, a sales summary, or a data‑driven web application.
If you encounter any issues or have questions, feel free to ask for help on the Aspose.Cells support forum.