corelibraries-devexpress-dot-xtracharts-dot-serieslabelbase-44d0e430.md
Specifies the direction of text within the series labels.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public virtual TextOrientation TextOrientation { get; set; }
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Overridable Property TextOrientation As TextOrientation
| Type | Description |
|---|---|
| TextOrientation |
A TextOrientation enumeration value that specifies the text direction for the series labels.
|
Available values:
| Name | Description |
|---|---|
| Horizontal |
The series labels are not rotated.
| | TopToBottom |
The series labels are rotated vertically, clockwise.
| | BottomToTop |
The series labels are rotated vertically, counterclockwise.
|
The following images demonstrate the TextOrientation property in action.
| TextOrientation = Horizontal | TextOrientation = TopToBottom | TextOrientation = BottomToTop |
|---|---|---|
This example demonstrates how to customize the Side-by-Side Bar series label position and appearance.
Use the following API members to customize bar series labels:
| Member | Description |
|---|---|
| Series.LabelsVisibility | Specifies whether to show series labels. |
| BarSeriesLabel | Defines label settings for bar series. |
| SeriesLabelBase.BackColor | Gets or sets the label’s background color. |
| SeriesLabelBase.Border | Gets the label’s border settings. |
| SeriesLabelBase.Font | Gets or sets the font used to display the label’s content. |
| BarSeriesLabel.Position | Specifies the position of series point labels, relative to their corresponding Bars. |
SeriesLabelBase.TextOrientation | Specifies the direction of text within the series labels. |
| SeriesLabelBase.TextPattern | Gets or sets a string which represents the pattern specifying the text to be displayed within series labels. |
private void OnFormLoad(object sender, EventArgs e) {
chartControl1.Series[0].LabelsVisibility = DevExpress.Utils.DefaultBoolean.True;
BarSeriesLabel seriesLabel = chartControl1.Series[0].Label as BarSeriesLabel;
seriesLabel.BackColor = Color.White;
seriesLabel.Border.Color = Color.DarkSlateGray;
seriesLabel.Font = new Font("Tahoma", 10, FontStyle.Regular);
seriesLabel.Position = BarSeriesLabelPosition.TopInside;
seriesLabel.TextOrientation = TextOrientation.Horizontal;
seriesLabel.TextPattern = "{V:F1}";
}
Private Sub OnFormLoad(ByVal sender As Object, ByVal e As EventArgs)
chartControl1.Series(0).LabelsVisibility = DevExpress.Utils.DefaultBoolean.[True]
Dim seriesLabel As BarSeriesLabel = TryCast(chartControl1.Series(0).Label, BarSeriesLabel)
seriesLabel.BackColor = Color.White
seriesLabel.Border.Color = Color.DarkSlateGray
seriesLabel.Font = New Font("Tahoma", 10, FontStyle.Regular)
seriesLabel.Position = BarSeriesLabelPosition.TopInside
seriesLabel.TextOrientation = TextOrientation.Horizontal
seriesLabel.TextPattern = "{V:F1}"
End Sub
See Also