Skip to main content

DataPointHitRegion Struct

Definition

Assembly:Avalonia.Controls.Charts
Package:Avalonia.Controls.Charts

Represents a hit test region for a data point on a chart. Used for detecting clicks on specific data points.

public struct DataPointHitRegion

Inheritance: ValueType -> DataPointHitRegion

Constructors

NameDescription
DataPointHitRegionCreates a new instance of DataPointHitRegion.

DataPointHitRegion Constructor

Creates a new instance of DataPointHitRegion.

public DataPointHitRegion(Avalonia.Rect bounds, object source, int index, object category, double value, object dataItem, Avalonia.Media.Geometry hitGeometry)

Parameters

bounds Avalonia.Rect

source object

index int

category object

value double

dataItem object

hitGeometry Avalonia.Media.Geometry

Methods

NameDescription
ContainsDetermines whether the provided point is inside the hit region.

Contains Method

Determines whether the provided point is inside the hit region.

public bool Contains(Avalonia.Point point)

Parameters

point Avalonia.Point

Returns

bool

Properties

NameDescription
BoundsGets the bounding rectangle for hit testing.
CategoryGets the category of the data point (if applicable).
DataItemGets the original data item from the source.
DataPointIndexGets the index of the data point.
HitGeometryGets the optional geometry for precise hit testing.
SelectableGets the series or selectable component that owns the data point.
SourceGets the source object (Series or Indicator) that owns this region.
ValueGets the value of the data point.

Bounds Property

Gets the bounding rectangle for hit testing.

public Avalonia.Rect Bounds { get; set; }

Category Property

Gets the category of the data point (if applicable).

public object Category { get; set; }

DataItem Property

Gets the original data item from the source.

public object DataItem { get; set; }

DataPointIndex Property

Gets the index of the data point.

public int DataPointIndex { get; set; }

HitGeometry Property

Gets the optional geometry for precise hit testing.

public Avalonia.Media.Geometry HitGeometry { get; set; }

Selectable Property

Gets the series or selectable component that owns the data point.

public Avalonia.Controls.Charts.IIndexSelectableChart Selectable { get; set; }

Source Property

Gets the source object (Series or Indicator) that owns this region.

public object Source { get; set; }

Value Property

Gets the value of the data point.

public double Value { get; set; }