Visualizing hierarchical data with a three‑dimensional effect can make reports more engaging. In this guide you will learn how to create a PyramidColumn3D chart in Excel programmatically using C# and Aspose.Cells for .NET. The example demonstrates adding data, inserting the chart, tweaking series settings and exporting the workbook to an Excel file.

This article covers the following topics:

Aspose.Cells .NET Library for PyramidColumn3D Charts

Aspose.Cells for .NET is a powerful, fully managed API that enables developers to create, modify, and render Excel files without Microsoft Office. It supports the full range of Excel chart types, including the PyramidColumn3D chart.

Key advantages of using Aspose.Cells:

  • Rich Chart API – Direct access to chart objects, series, axes, legends, and formatting.
  • No Interop Dependency – Works in any .NET environment (Desktop, Server, Cloud).
  • High Performance – Handles large workbooks with low memory footprint.
  • Multiple Formats – Save to XLSX, XLS, CSV, PDF, HTML, and image formats.

To start using Aspose.Cells, install the NuGet package:

PM> Install-Package Aspose.Cells

Create a Basic PyramidColumn3D Chart

The following example creates a simple workbook, populates it with sample data, adds a PyramidColumn3D chart, and saves the file as PyramidColumn3D_Basic.xlsx.

Explanation of key steps

StepWhat it does
1Instantiates a Workbook and accesses the first Worksheet.
2Populates the sheet with product names and quarterly sales values.
3Calls Charts.Add with ChartType.PyramidColumn3D to create the 3‑D pyramid column chart.
4Adds the data series (NSeries.Add) and sets the category (X‑axis) labels.
5Saves the workbook to an XLSX file that can be opened in Microsoft Excel.

Running the program produces an Excel file containing a 3‑D pyramid column chart that visualizes the sales data across four quarters.

Customize the PyramidColumn3D Chart (Colors, Axis, Legend)

Often you need to tailor the chart’s appearance to match corporate branding or improve readability. The example below demonstrates:

  • Changing column fill colors.
  • Adjusting legend position.
  • Modifying primary and secondary axes titles.
  • Enabling data labels.

What the custom code does

CustomizationCode snippetResult
Series colorschart.NSeries[s].Area.ForegroundColor = palette[s];Each year’s column appears in a distinct, brand‑friendly color.
Data labelschart.NSeries[s].DataLabels.IsValueShown = true;Numeric values are displayed above each column for quick insight.
Legend positioningchart.Legend.Position = LegendPositionType.Bottom;Legend placed below the chart, freeing up chart area.
Axis titles & number formatchart.CategoryAxis.Title.Text, chart.ValueAxis.NumberFormatImproves readability and conveys units.
Border removalchart.NSeries[s].Border.IsVisible = false;Gives a cleaner 3‑D appearance.

Open PyramidColumn3D_Customized.xlsx in Excel to see a polished, presentation‑ready chart.

Get a Free License

Aspose.Cells requires a license for full functionality. You can obtain a temporary free license for evaluation from the Aspose portal:

Free Temporary License for Aspose.Cells

Apply the license before generating charts in a production environment to remove evaluation watermarks.

// Example of applying a license (place this at the start of your program)
var license = new Aspose.Cells.License();
license.SetLicense("Aspose.Total.lic");   // Path to your .lic file

Additional Resources

Conclusion

Creating a PyramidColumn3D chart with Aspose.Cells for .NET is straightforward:

  1. Populate worksheet data.
  2. Add a ChartType.PyramidColumn3D chart.
  3. Set series, categories, and optional formatting.
  4. Save the workbook.

The library gives you full control over chart aesthetics, enabling you to produce professional‑grade visualizations directly from your C# applications.

If you need further assistance, feel free to join the Aspose community forums or explore the extensive documentation linked above.

See Also