Back to Devexpress

ConstantLine.RuntimeTitleEditing Property

corelibraries-devexpress-dot-xtracharts-dot-constantline-3b5ad72e.md

latest3.0 KB
Original Source

ConstantLine.RuntimeTitleEditing Property

Specifies whether a user can edit the constant line title.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
[XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)]
public bool RuntimeTitleEditing { get; set; }
vb
<XtraChartsLocalizableCategory(XtraChartsCategory.Behavior)>
Public Property RuntimeTitleEditing As Boolean

Property Value

TypeDescription
Boolean

true , if a user can edit the title; otherwise, false.

|

Remarks

Double-click the constant line title to edit it. Click Enter , Esc or a point outside the edit field to complete editing.

Example

The following example adds a horizontal constant line with an editable title. Once a user moves a constant line, the title is updated to display the current constant line value.

csharp
private void OnFormLoad(object sender, EventArgs e) {

    ConstantLine constantLine = new ConstantLine();
    constantLine.AxisValue = 65.0;
    constantLine.Title.Text = "Title";    
    constantLine.RuntimeTitleEditing = true;
    constantLine.RuntimeMoving = true;

    XYDiagram diagram = chartControl1.Diagram as XYDiagram;
    diagram.AxisY.ConstantLines.Add(constantLine);

    chartControl1.ConstantLineMoved += OnChartControlConstantLineMoved;
}

private void OnChartControlConstantLineMoved(object sender, ConstantLineMovedEventArgs e) {
    e.ConstantLine.Title.Text = String.Format("{0:f3}",e.ConstantLine.AxisValue);
}
vb
Private Sub OnFormLoad(ByVal sender As Object, ByVal e As EventArgs)

    Dim constantLine As ConstantLine = New ConstantLine()
    constantLine.AxisValue = 65.0
    constantLine.Title.Text = "Title"
    constantLine.RuntimeTitleEditing = True
    constantLine.RuntimeMoving = True

    Dim diagram As XYDiagram = TryCast(chartControl1.Diagram, XYDiagram)
    diagram.AxisY.ConstantLines.Add(constantLine)

    chartControl1.ConstantLineMoved += AddressOf OnChartControlConstantLineMoved
End Sub

Private Sub OnChartControlConstantLineMoved(ByVal sender As Object, ByVal e As ConstantLineMovedEventArgs)
    e.ConstantLine.Title.Text = String.Format("{0:f3}", e.ConstantLine.AxisValue)
End Sub

See Also

ConstantLine Class

ConstantLine Members

DevExpress.XtraCharts Namespace