Visualising the proportion of multiple data series relative to a total is a common requirement for business reporting. A 100 % Stacked Area chart (Area100PercentStacked) displays this data as filled areas whose heights sum to 100 % at every category point, making it ideal for showing market share, resource allocation, or any composition over time.
In this guide you will learn how to create an Area100PercentStacked chart in Excel using C# with Aspose.Cells for .NET. The example is complete, self‑contained and can be compiled and executed directly.
This article covers
- C# Excel Library to Create Area100PercentStacked Charts
- Create an Area100PercentStacked Chart in Excel using C#
- Update a Built‑in Area100PercentStacked Chart
- Get a Free License
- Free Resources
- Conclusion
- See Also
C# Excel Library to Create Area100PercentStacked Charts
Aspose.Cells for .NET is a comprehensive spreadsheet manipulation API that enables developers to create, edit, and render Excel files without Microsoft Excel installed. With its rich charting capabilities you can programmatically generate any Excel chart type, including the Area100PercentStacked chart.
Key advantages of using Aspose.Cells:
- Pure .NET API – No COM interop, works on any platform that supports .NET.
- Full format support – XLS, XLSX, CSV, ODS, and more.
- High performance – Efficient handling of large workbooks and data sets.
- Fine‑grained control – Access to every chart property, series, axes, and formatting options.
Getting Started
Download the latest Aspose.Cells .NET package from the releases page.
Install via NuGet:
PM> Install-Package Aspose.CellsAdd a reference to
Aspose.Cellsin your C# project.
Now you are ready to generate an Area100PercentStacked chart.
Create an Area100PercentStacked Chart in Excel using C#
Below is a complete, ready‑to‑run C# program that:
- Creates a new workbook.
- Populates sample data (Month vs. Sales of three product lines).
- Inserts an Area100PercentStacked chart.
- Customises titles, legends and axis values.
- Saves the workbook to an XLSX file.
Explanation of Key Steps
| Step | What it does |
|---|---|
| 1 | Instantiates a new Workbook and obtains the first Worksheet. |
| 2 | Populates the worksheet with sample data – months and three product sales series. |
| 3 | Adds an Area100PercentStacked chart to the worksheet. |
| 4 | Adds three series (Product A‑C) using the NSeries.Add method. |
| 5 | Links the X‑axis categories (months) to the chart. |
| 6 | Demonstrates optional customisation – legend position, axis titles, number format, and plot area colour. |
| 7 | Saves the workbook to Area100PercentStackedChart_Output.xlsx. |
Running the above program produces an Excel file that contains a fully formatted 100 % Stacked Area chart, ready for analysis or presentation.
Update a Built‑in Area100PercentStacked Chart
If you already have a chart in an existing workbook and need to convert it to an Area100PercentStacked type, you can modify the chart’s Type property for each series:
This snippet demonstrates how to re‑configure an existing chart without recreating it from scratch.
Get a Free License
Aspose.Cells offers a temporary free license that removes evaluation watermarks and enables all features. Obtain yours at the Aspose temporary license page. Apply the license before generating charts:
// Apply free temporary license (replace the path with your .lic file location).
var license = new License();
license.SetLicense("Aspose.Total.lic");
Area100PercentStacked Chart – Free Resources
- Developer’s Guide – https://docs.aspose.com/cells/net/
- Online Spreadsheet Editor – 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/
- Sample Projects on GitHub – https://github.com/aspose-cells/Aspose.Cells-for-.NET
Conclusion
Creating a 100 % Stacked Area chart with Aspose.Cells for .NET is straightforward:
- Prepare your data.
- Add a chart of type
ChartType.Area100PercentStacked. - Populate series and category data.
- Fine‑tune appearance and save.
The provided code snippets are complete, compile‑ready, and illustrate both new chart creation and modifying an existing chart. Incorporate these techniques into reporting dashboards, financial analyses, or any scenario where proportional data visualisation is required.
For further assistance, post your questions on the Aspose.Cells forum.