Back to Devexpress

XYDiagram.AxisX Property

corelibraries-devexpress-dot-xtracharts-dot-xydiagram-3d36fd23.md

latest4.9 KB
Original Source

XYDiagram.AxisX Property

Gets the X-axis.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[PersistenceMode(PersistenceMode.InnerProperty)]
[XtraChartsLocalizableCategory(XtraChartsCategory.Elements)]
public AxisX AxisX { get; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Elements)>
<PersistenceMode(PersistenceMode.InnerProperty)>
Public ReadOnly Property AxisX As AxisX

Property Value

TypeDescription
AxisX

An AxisX object which represents the X Axis.

|

Remarks

For more information on axes, see the Axis topic.

Example

This example demonstrates how to access and customize axis labels.

csharp
// 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.";
vb
' 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."

The following code snippets (auto-collected from DevExpress Examples) contain references to the AxisX property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-charts-sort-stacked-bars-by-total-values-with-qualitativescalecomparer/CS/Form1.cs#L50

csharp
}
AxisX axisX = ((XYDiagram)chartControl1.Diagram).AxisX;
axisX.QualitativeScaleComparer = new ArgumentByTotalComparer(argTotalDict);

winforms-charts-use-automatic-date-time-scale-modes-of-an-axis/CS/DateTimeAggregation/Form1.cs#L20

csharp
protected XYDiagram Diagram { get { return chartControl1.Diagram as XYDiagram; } }
protected AxisX AxisX { get { return Diagram.AxisX; } }
Series SeriesGBP { get { return chartControl1.Series[0]; } }

winforms-charts-sort-stacked-bars-by-total-values-with-qualitativescalecomparer/VB/Form1.vb#L50

vb
Next i
Dim axisX As AxisX = CType(chartControl1.Diagram, XYDiagram).AxisX
axisX.QualitativeScaleComparer = New ArgumentByTotalComparer(argTotalDict)

winforms-charts-use-automatic-date-time-scale-modes-of-an-axis/VB/DateTimeAggregation/Form1.vb#L28

vb
Get
    Return Diagram.AxisX
End Get

See Also

AxisY

XYDiagram Class

XYDiagram Members

DevExpress.XtraCharts Namespace