Working with the ThreeDFormat of Shape or Chart

Possible Usage Scenarios

Aspose.Cells provides the Shape.ThreeDFormat property along with ThreeDFormat class to work with the 3-D Format of shape or chart. The ThreeDFormat class contains different properties which can be set to achieve different results as per application requirements.

Working with the ThreeDFormat of Shape or Chart

The following sample code loads the source excel file and accesses the first shape in the first worksheet and sets the sub-properties of Shape.ThreeDFormat property and then saves the workbook in the output excel file.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
// Load excel file containing a shape
Workbook wb = new Workbook(dataDir + "sample.xlsx");
// Access first worksheet
Worksheet ws = wb.Worksheets[0];
// Access first shape
Shape sh = ws.Shapes[0];
// Apply different three dimensional settings
ThreeDFormat n3df = sh.ThreeDFormat;
n3df.ContourWidth = 17;
n3df.ExtrusionHeight = 32;
// Save the output excel file in xlsx format
wb.Save(dataDir + "output_out.xlsx");