Skip to main content

CrosshairLegendElement.SeriesPoint Property

Returns the series point which the Crosshair Cursor highlights.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v24.2.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public SeriesPoint SeriesPoint { get; }

Property Value

Type Description
SeriesPoint

The series point.

Remarks

Use the SeriesPoint property to get access the series point parameters when custom drawing a crosshair cursor using the ChartControl.CustomDrawCrosshair event.

Refer to the Tooltip and Crosshair Cursor document for more information about the Crosshair Cursor.

Example

This example demonstrates how to modify the Crosshair Cursor’s appearance using the ChartControl.CustomDrawCrosshair event.

In this sample, crosshair content is displayed in a legend. For this, set the CrosshairOptions.ContentShowMode to the Legend value that the CrosshairContentShowMode enumeration contains. Note that you can specify the crosshair’s content show mode for the specified series using the XYSeries2D.CrosshairContentShowMode property.

Use the CustomDrawCrosshairEventArgs.CrosshairLegendElements property to obtain the crosshair legend elements’ collection.

To customize each crosshair legend element options, use the CrosshairLegendElement class properties.

using System.Windows;
using System.Windows.Media;
using DevExpress.Xpf.Charts;
namespace CustomDrawCrosshair {
    public partial class MainWindow : Window {
        const int ColorSelectorValue = 10;
        public MainWindow() {
            InitializeComponent();
        }
        private void OnCustomDrawCrosshair(object sender, CustomDrawCrosshairEventArgs e) {
            foreach(CrosshairLegendElement legendElement in e.CrosshairLegendElements) {
                legendElement.Foreground = (legendElement.SeriesPoint.Value > ColorSelectorValue) ? Brushes.Green : Brushes.Red;
                legendElement.LineElement.Brush = legendElement.Foreground;
                legendElement.AxisLabelElement.Background = legendElement.Foreground;
            }            
        }
    }
}
See Also