Back to Devexpress

XYDiagram2D.ShowCrosshair(Object, Object, Axis2D, Axis2D, XYDiagramPaneBase) Method

corelibraries-devexpress-dot-xtracharts-dot-xydiagram2d-dot-showcrosshair-x28-system-dot-object-system-dot-object-devexpress-dot-xtracharts-dot-axis2d-devexpress-dot-xtracharts-dot-axis2d-devexpress-dot-xtracharts-dot-xydiagrampanebase-x29.md

latest3.3 KB
Original Source

XYDiagram2D.ShowCrosshair(Object, Object, Axis2D, Axis2D, XYDiagramPaneBase) Method

Shows the Crosshair Cursor at the diagram coordinate point related to the specified axes and pane.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public void ShowCrosshair(
    object argument,
    object value,
    Axis2D axisX = null,
    Axis2D axisY = null,
    XYDiagramPaneBase pane = null
)
vb
Public Sub ShowCrosshair(
    argument As Object,
    value As Object,
    axisX As Axis2D = Nothing,
    axisY As Axis2D = Nothing,
    pane As XYDiagramPaneBase = Nothing
)

Parameters

NameTypeDescription
argumentObject

The argument value.

| | value | Object |

The value.

|

Optional Parameters

NameTypeDefaultDescription
axisXAxis2Dnull

The X-axis by which the argument is measured.

| | axisY | Axis2D | null |

The Y-axis by which the value is measured.

| | pane | XYDiagramPaneBase | null |

The pane on which the Crosshair Cursor should be shown.

|

Remarks

The following code snippet shows the Crosshair Cursor for the DefaultPane and primary axes.

csharp
XYDiagram diagram = (XYDiagram)chartControl1.Diagram;
diagram.ShowCrosshair(new DateTime(2020, 6, 24), 71);
vb
Dim diagram As XYDiagram = CType(chartControl1.Diagram, XYDiagram)
diagram.ShowCrosshair(New DateTime(2020, 6, 24), 71)

The code snippet below shows the Crosshair Cursor for a specific pane and its axes.

csharp
XYDiagram diagram = (XYDiagram)chartControl1.Diagram;
diagram.ShowCrosshair(new DateTime(2020, 6, 24), 71, diagram.SecondaryAxesX[0], diagram.SecondaryAxesY[0], diagram.Panes[0]);
vb
Dim diagram As XYDiagram = CType(chartControl1.Diagram, XYDiagram)
diagram.ShowCrosshair(New DateTime(2020, 6, 24), 71, diagram.SecondaryAxesX(0), diagram.SecondaryAxesY(0), diagram.Panes(0))

See Also

XYDiagram2D Class

XYDiagram2D Members

DevExpress.XtraCharts Namespace