Skip to main content
A newer version of this page is available. .

AxisTitle.Alignment Property

Gets or sets the alignment of the axis title.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v19.1.dll

Declaration

[XtraSerializableProperty]
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public StringAlignment Alignment { get; set; }

Property Value

Type Description
StringAlignment

A StringAlignment enumeration value which specifies the alignment of the axis title.

Remarks

The following images demonstrate the Alignment property in action.

Near Center Far
AxisTitle_Near AxisTitle_Center AxisTitle_Far

For more information, refer to Axis Titles.

Example

This example demonstrates how to access an axis title at runtime.

To do this, cast your diagram object to the required diagram type to access its axes. Then, you can access the Axis2D.Title property.

// Cast the chart's diagram to the XYDiagram type, to access its axes.
XYDiagram diagram = (XYDiagram)chartControl1.Diagram;

// Customize the appearance of the X-axis title.
diagram.AxisX.Title.Visible = true;
diagram.AxisX.Title.Alignment = StringAlignment.Center;
diagram.AxisX.Title.Text = "X-axis Title";
diagram.AxisX.Title.TextColor = Color.Red;
diagram.AxisX.Title.Antialiasing = true;
diagram.AxisX.Title.Font = new Font("Tahoma", 14, FontStyle.Bold);

// Customize the appearance of the Y-axis title.
diagram.AxisY.Title.Visible = true;
diagram.AxisY.Title.Alignment = StringAlignment.Center;
diagram.AxisY.Title.Text = "Y-axis Title";
diagram.AxisY.Title.TextColor = Color.Blue;
diagram.AxisY.Title.Antialiasing = true;
diagram.AxisY.Title.Font = new Font("Tahoma", 14, FontStyle.Bold);
See Also