maui-devexpress-dot-maui-dot-charts-13d004cb.md
The collection of NumericConstantLine objects.
Namespace : DevExpress.Maui.Charts
Assembly : DevExpress.Maui.Charts.dll
NuGet Package : DevExpress.Maui.Charts
public class NumericConstantLineCollection :
ChartCollection<NumericConstantLine>
The following members return NumericConstantLineCollection objects:
A numeric constant line is a vertical or horizontal straight line that passes through the chart and indicates an x- or y-axis’s value.
Each axis can have any number of constant lines. A numeric axis (NumericAxisY or NumericAxisX ) holds its constant lines in the NumericConstantLineCollection collection which the NumericAxisY.ConstantLines or NumericAxisX.ConstantLines property returns.
This example shows how to add a constant line to a numeric y-axis, customize its appearance and show it in the chart legend. To do this, add a NumericConstantLine object with the specified properties to the NumericAxisY.ConstantLines collection.
<dxc:ChartView>
<!--...-->
<dxc:ChartView.AxisY>
<dxc:NumericAxisY>
<dxc:NumericAxisY.ConstantLines>
<dxc:NumericConstantLine AxisValue="{Binding ViewModel.NightTempAverage}"
ShowBehind="True"
VisibleInLegend="True"
LegendText="Average Annual">
<!-- Customize the constant line title. -->
<dxc:NumericConstantLine.Title>
<dxc:ConstantLineTitle Text="{Binding ViewModel.NightTempAverage, StringFormat='{0}°C'}"
Alignment="Far"
ShowBelowLine="False">
<dxc:ConstantLineTitle.Style>
<dxc:TitleStyle>
<dxc:TitleStyle.TextStyle>
<dxc:TextStyle Color="#7f43bf" Size="12"/>
</dxc:TitleStyle.TextStyle>
</dxc:TitleStyle>
</dxc:ConstantLineTitle.Style>
</dxc:ConstantLineTitle>
</dxc:NumericConstantLine.Title>
<!-- Customize the constant line appearance. -->
<dxc:NumericConstantLine.Style>
<dxc:ConstantLineStyle Stroke="#7f43bf" Thickness="2" Dashes="7 3"/>
</dxc:NumericConstantLine.Style>
</dxc:NumericConstantLine>
</dxc:NumericAxisY.ConstantLines>
</dxc:NumericAxisY>
</dxc:ChartView.AxisY>
</dxc:ChartView>
ICollection<NumericConstantLine>
IReadOnlyList<NumericConstantLine>
IReadOnlyCollection<NumericConstantLine>
IEnumerable<NumericConstantLine>
System.Object Collection<NumericConstantLine> ObservableCollection<NumericConstantLine> ChartCollection<NumericConstantLine> NumericConstantLineCollection
Yield<NumericConstantLineCollection>()
YieldIfNotNull<NumericConstantLineCollection>()
See Also