corelibraries-devexpress-dot-xtracharts-8753cc10.md
Provides data for the ChartControl.ConstantLineMoved event.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public class ConstantLineMovedEventArgs :
EventArgs
Public Class ConstantLineMovedEventArgs
Inherits EventArgs
ConstantLineMovedEventArgs is the data class for the following events:
The ChartControl.ConstantLineMoved event occurs when a user moves a constant line. A constant line can be moved if its ConstantLine.RuntimeMoving property is set to true.
Note that ConstantLineMovedEventArgs objects are automatically created, initialized and passed to ChartControl.ConstantLineMoved event handlers.
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.
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);
}
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
Object EventArgs ConstantLineMovedEventArgs
See Also