Skip to main content

How to: Display a Custom Cursor in the Chart Control

  • 2 minutes to read

This example shows how to display a custom cursor when the mouse pointer is hovering over the chart control.

To accomplish this task, handle the ChartControl.QueryChartCursor event and assign your custom image (e.g., a BitmapImage object loaded from application resources) to the QueryChartCursorEventArgs.CursorImage property.

Note that you need to include your image in the project and set the QueryChartCursorEventArgs.Cursor property to None to see the custom image in the chart control.

<Window x:Class="CustomCursor.MainWindow"
        Title="MainWindow" Height="350" Width="525" >
        <dxc:ChartControl Name="chartControl1" QueryChartCursor="chartControl1_QueryChartCursor">
                <dxc:XYDiagram2D >
                        <dxc:BarSideBySideSeries2D >
                                <dxc:SeriesPoint Argument="C" Value="5" />
                                <dxc:SeriesPoint Argument="B" Value="3" />
                                <dxc:SeriesPoint Argument="A" Value="1" />