Visualizing three‑dimensional data sets is essential for engineering, scientific, and financial analysis. A Surface3D chart provides a clear, color‑coded representation of values across two axes, making trends and patterns instantly recognizable. In this article you will learn how to create a Surface3D chart in Excel using C# with Aspose.Cells for .NET. The sample code creates a workbook, fills it with sample data, adds a Surface3D chart, customises its appearance, and saves the file in XLSX format.
This article covers the following topics:
- C# Excel Library to Create Surface3D Chart
- Create a Surface3D Chart in Excel using C#
- Get a Free License
- Free Resources
- Conclusion
- See Also
C# Excel Library to Create Surface3D Chart
Aspose.Cells for .NET is a comprehensive Excel automation library that enables developers to create, modify, and render Excel files without Microsoft Office. It supports all chart types, including the 3‑D Surface chart, and offers high‑performance APIs for large data sets.
Key advantages of using Aspose.Cells for .NET:
- Full‑featured API – Access every Excel feature programmatically.
- Robust chart support – Create 2‑D, 3‑D, and specialty charts such as Surface, Radar, and Stock.
- Performance‑optimized – Handles millions of cells with low memory footprint.
- Cross‑platform – Works on .NET Framework, .NET Core, .NET 5/6/7, and .NET Standard.
Installation
Install the library via NuGet:
PM> Install-Package Aspose.Cells
Or add the package reference to your project file:
<PackageReference Include="Aspose.Cells" Version="24.12.0" />
Create a Surface3D Chart in Excel using C#
Below is a complete, self‑contained C# console application that creates a Surface3D chart.
1. Create a new console project
dotnet new console -n Surface3DChartDemo
cd Surface3DChartDemo
dotnet add package Aspose.Cells
2. Replace Program.cs with the following code
Explanation of the key steps
| Step | What it does |
|---|---|
| 1 | Creates a new Workbook and accesses the first worksheet. |
| 2 | Fills the worksheet with a matrix of Z‑values and labels for the X and Y axes. |
| 3 | Adds a ChartType.Surface3D chart object and positions it on the sheet. |
| 4 | Sets the data range for the chart, linking categories (X) and series (Y) to the cells. |
| 5 | Demonstrates optional customisations: style, legend, axis titles, and plot area formatting. |
| 6 | Saves the workbook as an XLSX file. |
Run the project with dotnet run. The generated Surface3DChart_Output.xlsx will contain the data table and a fully rendered 3‑D Surface chart.
Get a Free License
Aspose offers a temporary free license for evaluation. Visit the Aspose temporary license page to obtain a 30‑day license key that unlocks all features, including chart generation, without any watermarks.
// Apply the temporary license (replace the path with your license file location)
var license = new License();
license.SetLicense(@"C:\Path\To\Aspose.Total.lic");
Surface3D Chart Excel: Free Resources
Continue expanding your Excel automation expertise with these free resources:
- Developer’s Guide – https://docs.aspose.com/cells/net/
- Online Demo & Converter – https://products.aspose.app/cells/family
- API Reference – https://reference.aspose.com/cells/net/
- How‑to Articles & Blog Posts – https://blog.aspose.com/categories/aspose.cells-product-family/
- Community Forum – https://forum.aspose.com/c/cells/9
Conclusion
Creating a Surface3D chart in Excel is straightforward with Aspose.Cells for .NET. The library abstracts the low‑level XML handling, letting you focus on data preparation and visual customisation. Use the provided code samples as a starting point, adapt the data matrix to your own scenario, and enjoy high‑quality, export‑ready 3‑D surface visualisations in minutes.
For any questions, issues, or feature requests, feel free to post on the Aspose support forum.