Visualizing data in a three‑dimensional format can make reports more engaging and easier to interpret. In this article, you’ll learn how to create a Cylinder chart in Excel using C# and Aspose.Cells for .NET. With a few lines of code you can generate a fully‑featured 3‑D cylinder chart, customize titles, axes, and styling, and export the workbook to XLSX, PDF, or image formats.
This article covers the following topics:
- C# Excel Library to Create Cylinder Charts
- Create a Cylinder Chart in Excel using C#
- Update an Existing Cylinder Chart
- Free License
- Free Resources
- Conclusion
- See Also
C# Excel Library to Create Cylinder Charts
Aspose.Cells for .NET is a comprehensive Excel automation library that enables developers to create, modify, and render Excel files without Microsoft Office. It fully supports 3‑D chart types, including Cylinder charts, and provides a clean, object‑oriented API.
Key advantages of using Aspose.Cells for .NET:
- Rich API Coverage – Access every Excel feature programmatically, from formulas to advanced chart types.
- High Performance – Process large workbooks efficiently with low memory footprint.
- Multiple Output Formats – Save to XLSX, XLS, CSV, PDF, HTML, and various image formats.
- No External Dependencies – Works on any .NET platform (including .NET Core and .NET 7+).
Get started in three simple steps:
Download the latest release from the Aspose.Cells releases page.
Install the NuGet package:
PM> Install-Package Aspose.CellsAdd
using Aspose.Cells;to your C# file and start coding.
Create a Cylinder Chart in Excel using C#
Below is a complete, ready‑to‑run example that demonstrates how to build a simple Cylinder chart from scratch.
Step‑by‑Step Explanation
- Create a new workbook and obtain the first worksheet.
- Populate the worksheet with sample data (categories and numeric values).
- Add a chart of type
ChartType.Cylinder. - Configure the chart title, series, and axes.
- Save the workbook to an XLSX file.
Complete C# Code
What the code does
- Lines 1‑9 – Import required namespaces.
- Lines 13‑19 – Create a new
Workbookand get the firstWorksheet. - Lines 22‑33 – Write header and sample data into cells
A1:B5. - Lines 36‑40 – Add a 3‑D Cylinder chart to the sheet and set a descriptive title.
- Lines 43‑48 – Add a data series bound to the value range, set the series name, and ensure the series type is
Cylinder. - Lines 51‑53 – Assign category (X‑axis) labels.
- Lines 56‑59 – Add titles to the category and value axes.
- Lines 62‑65 – Save the workbook as
CylinderChart_Output.xlsx.
Run the program, open the generated Excel file, and you will see a fully rendered Cylinder chart displaying quarterly sales figures.
Get a Free License
Aspose offers a temporary free license that removes evaluation watermarks and enables full API functionality for a limited period. Visit the Aspose temporary license page to obtain your free license and start using Aspose.Cells without restrictions.
Cylinder Chart Excel: Free Resources
Continue expanding your Excel automation expertise with these free resources:
- Developer’s Guide – Comprehensive documentation for Aspose.Cells API: https://docs.aspose.com/cells/net/
- Online Apps – Try chart generation directly in the browser: https://products.aspose.app/cells/family
- API Reference – Detailed members list and examples: https://reference.aspose.com/cells/net/
- How‑to Articles – Real‑world scenarios and step‑by‑step guides: https://blog.aspose.com/categories/aspose.cells-product-family/
Conclusion
In this post we demonstrated how to create, customize, and convert a Cylinder chart in Excel using C# and Aspose.Cells for .NET. The library’s powerful charting capabilities let you produce professional 3‑D visualizations with minimal code, and the same API works across all .NET platforms.
Feel free to experiment with additional styling options—such as formatting the chart area, applying color gradients, or exporting to PDF/PNG—to meet the exact needs of your reporting solutions. If you encounter any difficulties, the Aspose support forums are always ready to help.