Visualizing statistical distributions helps analysts quickly identify data spread, outliers, and median values. In this guide you’ll learn how to create a BoxWhisker chart (also known as a box‑and‑whisker plot) in Excel using C# with Aspose.Cells for .NET. The examples cover basic chart creation, data preparation, and a few customizations such as axis titles and styling. All code snippets are complete and ready to compile.
This article covers the following topics:
- C# Excel Library to Create BoxWhisker Charts
- Create a BoxWhisker Chart in Excel using C#
- Get a Free License
- BoxWhisker Chart Excel: Free Resources
- Conclusion
- See Also
C# Excel Library to Create BoxWhisker Charts
Aspose.Cells for .NET is a powerful Excel automation library that makes it easy to generate, modify, and format Excel files programmatically. It supports the full range of Excel chart types, including the statistical BoxWhisker chart.
Key benefits of using Aspose.Cells for .NET:
- Rich API – Access to all Excel features, from formulas to advanced charting.
- No Microsoft Office Dependency – Works on any platform that supports .NET.
- High Performance – Handles large workbooks efficiently.
- Multiple Format Support – XLSX, XLS, CSV, PDF, ODS, and more.
Getting Started
Download the latest Aspose.Cells for .NET from the 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 BoxWhisker chart.
Create a BoxWhisker Chart in Excel using C#
1. Basic BoxWhisker Chart
The following example creates a simple workbook, populates it with statistical data, and adds a BoxWhisker chart.
Explanation of key steps
| Step | What it does |
|---|---|
| Create workbook | Instantiates a new Excel file. |
| Populate data | Inserts category names in column A and three data series in columns B‑D. |
| Add chart | ChartType.BoxWhisker creates the BoxWhisker chart object. |
| Set data range | NSeries.Add links the numeric data, while CategoryData links the categories. |
| Customizations | Adjusts axis titles, background color, and displays median data labels. |
| Save | Writes the workbook to disk (.xlsx). |
2. Advanced Customizations (Styling & Outlier Display)
The next example demonstrates how to change the box fill color, outline style, and configure the outlier marker.
What this example adds
- Series‑specific formatting – Different fill colors and border styles for each data series.
- Outlier visualization – Turns on outlier points and customizes the marker to a red circle.
- Clear axis titles – Helps end‑users understand the chart context.
Both snippets can be compiled with .NET 6+ (or any .NET version supported by Aspose.Cells) and run without requiring Microsoft Office.
Get a Free License
Want to try Aspose.Cells without limitations? Obtain a temporary free license from the Aspose temporary license page. The license removes the evaluation watermark and unlocks the full API, allowing you to experiment with BoxWhisker charts and other features in your applications.
BoxWhisker Chart Excel: Free Resources
Continue learning with these official Aspose resources:
- Developer’s Guide – https://docs.aspose.com/cells/net/
- Free Online Apps – 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 statistical visualizations such as BoxWhisker charts is straightforward with Aspose.Cells for .NET. The library provides full control over data ranges, chart types, and styling, enabling you to embed professional‐grade analytics directly into Excel workbooks. Use the provided code samples as a starting point, then explore further customizations to meet your reporting needs.
If you encounter any issues or have questions, feel free to ask for help on the Aspose.Cells support forum.