Skip to main content

View3DOptions.XRotation Property

Gets or sets the value in degrees at which a 3-D chart should be rotated around the X-axis.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

int XRotation { get; set; }

Property Value

Type Description
Int32

An integer value which specifies the rotation angle in degrees. This value must be between -90 and 90.

Property Paths

You can access this nested property as listed below:

Object Type Path to XRotation
ChartObject
.View3D .XRotation

Remarks

To rotate the 3-D chart in the Y-direction, use the View3DOptions.YRotation property.

Example

The example below demonstrates how to create the 3-D pie chart and rotate it around the Y-axis by 225° using the View3DOptions.YRotation property.

View Example

Worksheet worksheet = workbook.Worksheets["chartTask3"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Create a chart and specify its location
Chart chart = worksheet.Charts.Add(ChartType.Pie3D);
chart.TopLeftCell = worksheet.Cells["H2"];
chart.BottomRightCell = worksheet.Cells["N14"];

// Add the data series
chart.Series.Add(worksheet["E2"], worksheet["B3:B6"], worksheet["E3:E6"]);

// Set the explosion value for the slice
chart.Series[0].CustomDataPoints.Add(2).Explosion = 25;

// Set the rotation of the  3-D chart view
chart.View3D.YRotation = 255;

// Set the chart style
chart.Style = ChartStyle.ColorGradient;
See Also