Skip to main content
A newer version of this page is available. .

ConstantLineTitle Class

Stores constant line title settings.

Namespace: DevExpress.XamarinForms.Charts

Assembly: DevExpress.XamarinForms.Charts.dll

NuGet Package: DevExpress.XamarinForms.Charts

Declaration

public class ConstantLineTitle :
    TitleBase

The following members return ConstantLineTitle objects:

Remarks

The ConstantLineTitle class properties define the common settings of a constant line title:

  • Text - Specifies the constant line title text.
  • Style - Provides access to the title text appearance settings (text color and size).
  • Visible - Allows you to show and hide the constant line title.
  • Alignment - Specifies the constant line title alignment.
  • ShowBelowLine - Specifies whether the title is displayed below or above the constant line.

To create and configure a constant line title, assign a ConstantLineTitle object with the specified properties to the constant line’s Title 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.

NumericAxisY Constant Line

<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>

Inheritance

Object
Xamarin.Forms.BindableObject
See Also