QueryChartCursorEventArgs.Cursor Property
Gets or sets the mouse cursor currently being shown for the chart.
Namespace: DevExpress.Xpf.Charts
Assembly: DevExpress.Xpf.Charts.v20.2.dll
NuGet Packages: DevExpress.WindowsDesktop.Wpf.Charts, DevExpress.Wpf.Charts
Declaration
Property Value
Type | Description |
---|---|
Cursor | A Cursor object. |
Remarks
To obtain the custom cursor type in the ChartControl.QueryChartCursor event handler, use the QueryChartCursorEventArgs.CursorImage property.
Example
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"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/charts"
Title="MainWindow" Height="350" Width="525" >
<Grid>
<dxc:ChartControl Name="chartControl1" QueryChartCursor="chartControl1_QueryChartCursor">
<dxc:ChartControl.Diagram>
<dxc:XYDiagram2D >
<dxc:XYDiagram2D.Series>
<dxc:BarSideBySideSeries2D >
<dxc:BarSideBySideSeries2D.Points>
<dxc:SeriesPoint Argument="C" Value="5" />
<dxc:SeriesPoint Argument="B" Value="3" />
<dxc:SeriesPoint Argument="A" Value="1" />
</dxc:BarSideBySideSeries2D.Points>
</dxc:BarSideBySideSeries2D>
</dxc:XYDiagram2D.Series>
</dxc:XYDiagram2D>
</dxc:ChartControl.Diagram>
</dxc:ChartControl>
</Grid>
</Window>
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Cursor property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.