HitTest Method (Int32, Int32, ChartElementType)
Collapse the table of content
Expand the table of content

Chart.HitTest Method (Int32, Int32, ChartElementType)

.NET Framework (current version)
 

Determines whether a chart element of a given type is located at a point defined by the given X and Y coordinates.

Namespace:   System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

public HitTestResult HitTest(
	int x,
	int y,
	ChartElementType requestedElement
)

Parameters

x
Type: System.Int32

The X-coordinate value of the point the user clicked on.

y
Type: System.Int32

The Y-coordinate value of the point the user clicked on.

requestedElement
Type: System.Web.UI.DataVisualization.Charting.ChartElementType

A flag that determines the chart element type to be tested.

Return Value

Type: System.Web.UI.DataVisualization.Charting.HitTestResult

A HitTestResult object that provides information about the chart element, if any, found at the specified location.

Call this method to determine if a chart element of the given type is located at a specified point.

System_CAPS_importantImportant

In order for this method to work correctly, the IsMapEnabled property must be set to false.

This method can be used with the Click server-side event when you implement drilldown. However, it is highly recommended that you use client-side image maps for drilldown because of ease of use.

The properties of the returned HitTestResult object can then be used to determine which chart element was clicked; the HitTestResult object also provides an instance of the actual object selected, if any.

.NET Framework
Available since 4.0
Return to top
Show:
© 2016 Microsoft