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

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

  1. Download the latest Aspose.Cells for .NET from the releases page.

  2. Install the NuGet package:

    PM> Install-Package Aspose.Cells
    
  3. Add a reference to Aspose.Cells in 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

StepWhat it does
Create workbookInstantiates a new Excel file.
Populate dataInserts category names in column A and three data series in columns B‑D.
Add chartChartType.BoxWhisker creates the BoxWhisker chart object.
Set data rangeNSeries.Add links the numeric data, while CategoryData links the categories.
CustomizationsAdjusts axis titles, background color, and displays median data labels.
SaveWrites 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:

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.

See Also