mobilecontrols-devexpress-dot-xamarinforms-dot-charts-a3c8aab5.md
The X-axis the chart uses to display series that represent data sources with numeric arguments.
Namespace : DevExpress.XamarinForms.Charts
Assembly : DevExpress.XamarinForms.Charts.dll
NuGet Package : DevExpress.XamarinForms.Charts
public class NumericAxisX :
AxisX
The following image highlights elements the axis includes:
|
|
|
|
The ChartView.AxisX property contains the X-axis the chart uses to arrange series:
<dxc:ChartView>
<dxc:ChartView.AxisX>
<dxc:NumericAxisX>
</dxc:ChartView.AxisX>
</dxc:ChartView>
Note
The chart creates axes compatible with the first series’ data type if the chart does not have specified axes.
The X-axis automatically calculates the value range by data of all series that the axis measures. To show a particular value interval, specify the range’s VisualMin and VisualMax properties:
<dxc:NumericAxisX>
<dxc:NumericAxisX.Range>
<dxc:NumericRange VisualMin="10" VisualMax="90">
</dxc:NumericAxisX.Range>
</dxc:NumericAxisX>
Note
Chart zooming and scrolling change visual values. To limit the interval in which users can change a visual range, use NumericRange.Min and NumericRange.Max properties.
The following table lists all classes and properties the code above uses:
|
Symbol
|
Description
| | --- | --- | |
|
Specifies the axis range settings.
| |
|
Stores range settings of NumericAxisX and NumericAxisY.
| |
|
Gets or sets the start value of the axis range that is currently displayed on a screen.
| |
|
Gets or sets the end value of the axis range that is currently displayed on a screen.
| |
|
Gets or sets the minimum scale value of the axis.
| |
|
Gets or sets the maximum scale value of the axis.
|
The X-Axis provides settings that manage how the axis lays out its grid lines, tick marks, and labels. The image below demonstrates these settings:
The following code customizes these parameters:
<dxc:NumericAxisX GridOffset="5" GridAlignment="10"/>
Axis Labels show the textual representation of axis values at which the axis places major tick marks and grid lines:
The code snippet below demonstrates how to customize axis labels:
<dxc:NumericAxisX>
<dxc:NumericAxisX.Label>
<dxc:AxisLabel TextFormat="0.##">
<dxc:NumericAxisX.Label>
</dxc:NumericAxisX>
The code above uses the following class and property:
|
Symbol
|
Description
| | --- | --- | |
|
Provides access to the settings that specify the text format, position, and appearance of axis labels.
| |
|
Stores axis label settings.
|
The Axis Title is additional text that explains the values the axis measures:
The markup below enables the title that the image above shows:
<dxc:NumericAxisX>
<dxc:NumericAxisX.Title>
<dxc:AxisTitle Text="Year">
<dxc:NumericAxisX.Title>
</dxc:NumericAxisX>
The following table lists API that the markup above uses:
|
Symbol
|
Description
| | --- | --- | |
|
Specifies the axis title.
| |
|
Stores axis title settings.
|
A Constant Line highlights a specific axis value by a perpendicular straight line with a title:
The following code adds the constant line to the X-axis:
<dxc:NumericAxisX>
<dxc:NumericAxisX.ConstantLines>
<dxc:NumericConstantLine AxisValue="2019" LegendText="Nowadays">
<dxc:NumericConstantLine.Title>
<dxc:ConstantLineTitle Text="Nowadays">
</dxc:NumericConstantLine.Title>
</dxc:NumericConstantLine>
<dxc:NumericAxisX.ConstantLines>
</dxc:NumericAxisX>
The code above used the following classes and properties:
|
Symbol
|
Description
| | --- | --- | |
|
Gets the collection of constant lines that the axis contains.
| |
|
The vertical or horizontal straight line that passes through the chart and indicates a qualitative x- or y-axis’s value.
| |
|
Gets or sets the constant line position along the numeric axis.
| |
|
Gets or sets the text that identifies the constant line in the chart legend.
| |
|
Gets or sets settings of the constant line title.
| |
|
Stores constant line title settings.
| |
|
Gets or sets the text the title displays.
|
A Strip highlights a specific range of axis values using a perpendicular straight area with an axis label:
Note
The axis hides its labels when any strip has a label.
The following code adds the strip to the X-axis:
<dxc:NumericAxisX>
<dxc:NumericAxisX.Strips>
<dxc:NumericStrip MinLimit="2019" MaxLimitEnabled="False">
<dxc:NumericStrip.AxisLabel>
<dxc:StripAxisLabel Text="Future">
</dxc:NumericStrip.AxisLabel>
</dxc:NumericStrip>
<dxc:NumericAxisX.Strips>
</dxc:NumericAxisX>
The code above used the following classes and properties:
|
Symbol
|
Description
| | --- | --- | |
|
Gets the collection of strips that the axis contains.
| |
|
The highlighted area limited by two fixed values (minimal and maximal limits) of an axis, and is perpendicular to the axis.
| |
|
Gets or sets the minimum limiting value of the strip along an axis.
| |
|
Indicates whether the strip is limited by its MinLimit value.
| |
|
Gets or sets the maximum limiting value of the strip along an axis.
| |
|
Indicates whether the strip is limited by its MaxLimit value.
| |
|
Gets or sets a text the strip provides to the chart legend.
| |
|
Gets or sets the axis label the strip displays on the axis to which the strip belongs.
| |
|
Stores the strip’s axis label settings.
| |
|
Specifies the text of a strip’s axis label.
|
The axis provides the Style property that stores the appearance of the following elements:
| |
Element
|
Properties That Affect the Element
| | --- | --- | --- | |
|
Axis Line
|
LineColor, LineThickness, LineVisible
| |
|
Major Tick Marks
|
LineColor, MajorTickmarksThickness, MajorTickmarksLength, MajorTickmarksVisible
| |
|
Minor Tick Marks
|
LineColor, MinorTickmarksThickness, MinorTickmarksLength, MinorTickmarksVisible
| |
|
Major Grid Lines
|
MajorGridlinesThickness, MajorGridlinesColor, MajorGridlinesVisible
| |
|
Minor Grid Lines
|
MinorGridlinesThickness, MinorGridlinesColor, MinorGridLinesVisible
|
Note
Labels, Titles, Constant Lines and Strips provide their Style properties that manage the appearance of these elements.
Object ChartElement StyledElement AxisBase AxisX NumericAxisX
See Also