Working with the ThreeDFormat of Shape or Chart
Possible Usage Scenarios
Aspose.Cells provides the Shape.ThreeDFormat property to work with the 3-D Format of shape or chart. It contains different sub-properties which you can set to achieve different results as per your requirements.
The following screenshot shows Microsoft Excel interface to set the 3-D Format of Shape.
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.
Sample Code
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getSharedDataDir(WorkingWithThreeDFormat.class) + "articles/"; | |
//Load excel file containing a shape | |
Workbook wb = new Workbook(dataDir + "WorkingWithThreeDFormat_in.xlsx"); | |
//Access first worksheet | |
Worksheet ws = wb.getWorksheets().get(0); | |
//Access first shape | |
Shape sh = ws.getShapes().get(0); | |
//Apply different three dimensional settings | |
ThreeDFormat n3df = sh.getThreeDFormat(); | |
n3df.setContourWidth(17); | |
n3df.setExtrusionHeight(32); | |
n3df.setTopBevelType(BevelType.HARD_EDGE); | |
n3df.setTopBevelWidth (30); | |
n3df.setTopBevelHeight(30); | |
//Save the output excel file in xlsx format | |
wb.save(dataDir + "WorkingWithThreeDFormat_out.xlsx"); |