LineMarker displays the precise data values for a given position on the chart by dragging horizontal or vertical lines over the plot with an attached label. It is useful in scenarios, where a user has a lot of data in a line or area chart, or if a user wants to display data from multiple series in a single label. With built-in interactions, such as Drag and Move, a user can drag the line marker and more precisely select the data point on the chart.
The following image shows LineMarker displaying data values for a specific position on the chart.
To create a line marker and use it in FlexChart, create an instance of the C1.Win.Chart.Interaction.LineMarker class. While creating the instance, pass a parameter that is an object of the C1.Win.Chart.FlexChart type. Use the Lines property provided by LineMarker to set the visibility of the LineMarker lines. The Lines property accepts the following values from the LineMarkerLines enumeration:
The LineMarker class also provides the Alignment property to set the alignment of the line marker. In addition, set the interaction mode of the line marker by setting the Interaction property to any of the following values in the LineMarkerInteraction enumeration:
If you set the Interaction property to Drag, you need to set the DragContent and the DragLines property to specify whether the content and values linked with the line marker lines are draggable or not. In addition, the LineMarker class provides the Content property that you can use to customize the text content of the line marker. Furthermore, you can set the initial position of the line marker relative to the plot area with the help of VerticalPosition and HorizontalPostion properties. The acceptable range for these properties is [0,1].
The following code snippet implements the aforementioned classes and properties.