Visualizing proportional data across categories is a common reporting requirement. A 100 % Stacked Bar chart (also called Bar100PercentStacked) displays the contribution of each series as a percentage of the total for a given category, making it ideal for comparing parts‑to‑whole relationships. This guide shows you how to generate such a chart in Excel using Aspose.Cells for .NET with just a few lines of C# code.

In this article you will learn:

C# Excel Library to Create Bar100PercentStacked Chart

Aspose.Cells for .NET is a comprehensive spreadsheet API that enables developers to create, edit, and render Excel files without needing Microsoft Office. It fully supports chart creation, including the Bar100PercentStacked type.

Key advantages of using Aspose.Cells for charting:

  • Rich Chart Types – Over 50 built‑in chart types, including 100 % stacked bar.
  • Fine‑grained Control – Access to series, axes, legends, data labels, and formatting.
  • Cross‑Platform – Works on Windows, Linux, and macOS with .NET Core/5/6/7.
  • No COM Interop – No Office installation required on the server.

Getting Started

Add Aspose.Cells to your project via NuGet:

dotnet add package Aspose.Cells

Or using the Package Manager Console:

PM> Install-Package Aspose.Cells

Now you are ready to create a 100 % stacked bar chart.

Create a Bar100PercentStacked Chart in Excel using C#

The following example demonstrates how to:

  1. Create a new workbook and populate it with sample data.
  2. Add a Bar100PercentStacked chart.
  3. Configure series, axes, and data labels.
  4. Save the workbook to an .xlsx file.

Explanation of key steps

StepWhat it does
4Adds a chart of type Bar100PercentStacked.
5‑6Creates three series (Q1‑Q3) and links them to the data range.
7Turns on data labels and configures them to display percentages rather than raw values.
8Sets axis titles and forces the value axis to display percentages (0‑100%).

Running the program produces an Excel file where each region’s bar is divided into three colored segments representing Q1, Q2, and Q3 sales as a proportion of that region’s total sales.

Customize an Existing Bar100PercentStacked Chart

Sometimes you need to modify a chart that already exists in a workbook—e.g., change colors, add a legend, or switch the series order. The snippet below shows how to load an existing file, adjust the chart, and re‑save it.

What this code does

  • Loads the previously generated workbook.
  • Retrieves the first chart (our 100 % stacked bar chart).
  • Applies a custom colour palette to each series.
  • Ensures a legend appears on the right side.
  • Updates the chart title.
  • Saves the changes into a new file.

Get a Free License

Aspose.Cells is a commercial product, but you can obtain a temporary free license for evaluation purposes. Visit the Aspose temporary license page to request a 30‑day license key. Apply the key in your code as follows:

// Load the license file (temporary_license.xml) placed in the application folder.
var license = new Aspose.Cells.License();
license.SetLicense("temporary_license.xml");

Running your application with a valid license removes the evaluation watermark and unlocks full functionality.

Bar100PercentStacked Chart: Free Resources

Conclusion

Creating a Bar100PercentStacked chart with Aspose.Cells for .NET is straightforward: populate your data, add the chart, link series, and optionally fine‑tune formatting. The provided examples cover both fresh chart creation and post‑creation customization, giving you a solid foundation for integrating proportional visualizations into any .NET workbook‑generation workflow.

If you encounter any issues or have further questions, feel free to ask on the Aspose.Cells forum or reach out through our support channels.

See Also