Visualizing hierarchical or cumulative data often calls for a stacked bar chart with a 3‑D look. Aspose.Cells for .NET makes it straightforward to generate a Cylindrical Bar Stacked chart directly from code. Whether you are building a financial dashboard, a sales‑by‑region report, or any other stacked‑bar scenario, the following guide will walk you through creating, customizing, and saving the chart using C#.
This article covers the following topics:
- C# Excel Library to Create Cylindrical Bar Stacked Charts
- Create a Cylindrical Bar Stacked Chart in Excel using C#
- Get a Free License
- Free Resources
- Conclusion
- See Also
C# Excel Library to Create Cylindrical Bar Stacked Charts
Aspose.Cells for .NET is a comprehensive Excel manipulation library that eliminates the need for Microsoft Office automation. It provides a rich set of charting APIs, including the CylindricalBarStacked type, which renders stacked bar series as 3‑D cylinders.
Key benefits of using Aspose.Cells for chart creation:
- Full .NET Integration – Works with .NET 6+, .NET Framework, and .NET Core.
- No Office Dependency – Runs on servers, containers, and CI/CD pipelines without Office installed.
- High Performance – Handles large workbooks and complex charts efficiently.
- Multiple Format Support – Save to XLSX, XLS, CSV, PDF, PNG, JPEG, and more.
Getting Started
Download the latest Aspose.Cells for .NET from the releases page.
Add the library to your project via NuGet:
PM> Install-Package Aspose.Cells
Now you are ready to create a Cylindrical Bar Stacked chart programmatically.
Create a Cylindrical Bar Stacked Chart in Excel using C#
Below is a complete, compilable C# example that demonstrates:
- Creating a new workbook.
- Populating sample data.
- Adding a CylindricalBarStacked chart.
- Customizing series, axes, and appearance.
- Saving the workbook to an XLSX file.
Explanation of the Code
| Step | What the code does |
|---|---|
| 1 | Creates an empty workbook and retrieves the first worksheet. |
| 2 | Populates the worksheet with sample sales data for four regions and three products. |
| 3 | Adds a CylindricalBarStacked chart positioned below the data table. |
| 4 | Adds three series, one for each product, and links them to the corresponding data range. |
| 5 | Sets the category (X‑axis) labels to the region names. |
| 6 | Demonstrates common visual tweaks: border, plot‑area formatting, legend placement, and axis titles. |
| 7 | Saves the workbook to an XLSX file that can be opened in Excel, Google Sheets, or any compatible viewer. |
Running the program generates CylindricalBarStackedChart_Output.xlsx containing a 3‑D stacked cylindrical bar chart that visually aggregates product sales per region.
Get a Free License
Aspose.Cells requires a license for full functionality. You can obtain a temporary free license for evaluation from the Aspose temporary license page. The license file can be applied in your code as shown in the license documentation.
Free Resources
- Developer’s Guide – Comprehensive API reference and tutorials: https://docs.aspose.com/cells/net/
- Online Apps – Try chart creation without coding: https://products.aspose.app/cells/family
- API Reference – Detailed members and properties: https://reference.aspose.com/cells/net/
- How‑To Articles – Real‑world scenarios and sample projects: https://blog.aspose.com/categories/aspose.cells-product-family/
Conclusion
Creating a Cylindrical Bar Stacked chart with Aspose.Cells for .NET is a matter of a few lines of code. The library abstracts the complexity of Excel chart objects while giving you full control over data, layout, and visual styling. Use the example above as a starting point and adapt it to your own reporting requirements—whether you need to feed the chart from a database, apply conditional formatting, or export the result to PDF or an image.
If you encounter any challenges or have questions, feel free to post them on our free support forum.