corelibraries-devexpress-dot-xtracharts-2c1df180.md
Represents the primary X-axis within a chart control in 2D series, except for the Swift Plot and Swift Point.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public class AxisX :
AxisXBase
Public Class AxisX
Inherits AxisXBase
The following members return AxisX objects:
The AxisX class represents the primary axis of arguments (x-axis) within a chart control in 2D series (except for the Swift Plot and Swift Point). It inherits properties and methods from the base Axis class, which implements the common axes functionality.
An object of the AxisX type can be accessed via the XYDiagram.AxisX property of an XYDiagram object, which in its turn is exposed via the ChartControl.Diagram property.
A diagram‘s secondary X-axis is represented by the SecondaryAxisX class. And, for Swift Plot charts, the SwiftPlotDiagramAxisX class provides similar functionality.
For more information, refer to Axes.
This example demonstrates how to access and customize axis labels.
// Cast the chart's diagram to the XYDiagram type, to access its axes.
XYDiagram diagram = (XYDiagram)chartControl1.Diagram;
// Customize the X-axis labels' appearance.
diagram.AxisX.Label.Angle = -30;
diagram.AxisX.Label.Staggered = true;
diagram.AxisX.Label.TextColor = Color.Bisque;
// As opposed to the above properties, the following ones
// will not affect custom labels, if they exist for the axes.
diagram.AxisX.Label.BeginText = "Some prefix ";
diagram.AxisX.Label.EndText = " some postfix.";
' Cast the chart's diagram to the XYDiagram type, to access its axes.
Dim diagram As XYDiagram = CType(chartControl1.Diagram, XYDiagram)
' Customize the X-axis labels' appearance.
diagram.AxisX.Label.Angle = - 30
diagram.AxisX.Label.Staggered = True
diagram.AxisX.Label.TextColor = Color.Bisque
' As opposed to the above properties, the following ones
' will not affect custom labels, if they exist for the axes.
diagram.AxisX.Label.BeginText = "Some prefix "
diagram.AxisX.Label.EndText = " some postfix."
IXtraSupportDeserializeCollectionItem
Object ChartElement ChartElementNamed AxisBase Axis2D Axis AxisXBase AxisX GanttAxisX
See Also