ConstantLineBase.Style Property
Gets or sets the constant line appearance settings.
Namespace: DevExpress.XamarinForms.Charts
Assembly: DevExpress.XamarinForms.Charts.dll
Declaration
public ConstantLineStyle Style { get; set; }
Property Value
Type | Description |
---|---|
ConstantLineStyle | An object that specifies the constant line appearance. |
Remarks
To customize the constant line thickness and color, create a ConstantLineStyle object, specify its Thickness and Stroke properties, and assign this object to the Style property.
Example
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="100" ShowBehind="False"
VisibleInLegend="True" LegendText="Constant Line Sample">
<!-- Customize the constant line title. -->
<dxc:NumericConstantLine.Title>
<dxc:ConstantLineTitle Text="Constant Line Sample" ShowBelowLine="True" Alignment="Far">
<dxc:ConstantLineTitle.Style>
<dxc:TitleStyle>
<dxc:TitleStyle.TextStyle>
<dxc:TextStyle Color="DarkBlue" Size="24"/>
</dxc:TitleStyle.TextStyle>
</dxc:TitleStyle>
</dxc:ConstantLineTitle.Style>
</dxc:ConstantLineTitle>
</dxc:NumericConstantLine.Title>
<!-- Customize the constant line appearance. -->
<dxc:NumericConstantLine.Style>
<dxc:ConstantLineStyle Thickness="3"/>
</dxc:NumericConstantLine.Style>
</dxc:NumericConstantLine>
</dxc:NumericAxisY.ConstantLines>
</dxc:NumericAxisY>
</dxc:ChartView.AxisY>
</dxc:ChartView>
See Also