officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-shapetextformat-5b1ffebf.md
Gets or sets the rotation angle of the text in a chart element.
Namespace : DevExpress.Spreadsheet.Charts
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
int TextRotation { get; set; }
Property TextRotation As Integer
| Type | Description |
|---|---|
| Int32 |
An integer value which specifies the rotation angle in degrees. This value must be between -90 and 90.
|
Use the TextRotation property to rotate the text displayed in the chart elements listed below.
Note
DevExpress SpreadsheetControl does not take the TextRotation property into account. However, you can access the property in code, export the document in supported formats, and see changes in Microsoft Excel.
Axis Labels
To rotate the text in axis labels, use the TextRotation property of the Axis object. DevExpress SpreadsheetControl takes this property into account.
var chart = spreadsheetControl1.ActiveWorksheet.Charts[0];
chart.PrimaryAxes[0].TextRotation = -45;
Dim chart = spreadsheetControl1.ActiveWorksheet.Charts(0)
chart.PrimaryAxes(0).TextRotation = -45
The TextRotation property has no effect on the visual appearance of axis labels in the following charts:
Chart TitleUse the the ChartObject.Title property to access the ChartTitle object.Axis TitleUse the Axis.Title property to access the ChartTitleOptions object.Data LabelsUse the the ChartView.DataLabels property to access the DataLabelOptions object.Trendline LabelUse the Trendline.Label property to access the TrendlineLabel object.Unit Label of the Value AxisUse the TextRotation property of the DisplayUnitOptions object. See Also