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

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

StepWhat it does
1Creates a new Workbook and accesses the first worksheet.
2Fills the worksheet with a matrix of Z‑values and labels for the X and Y axes.
3Adds a ChartType.Surface3D chart object and positions it on the sheet.
4Sets the data range for the chart, linking categories (X) and series (Y) to the cells.
5Demonstrates optional customisations: style, legend, axis titles, and plot area formatting.
6Saves 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:

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.

See Also