ChartHitResult
public readonly struct ChartHitResultA shape-aware hit result. ChartHitResult.Position is in the host's surface pixels with a bottom-left origin; hits
on 3D charts also carry the world point, the ray distance and the data value under the pointer.
Constructors
Section titled “Constructors”
ChartHitResult(int, ChartHitKind, Vector2, Rect, Color)
Section titled “ChartHitResult(int, ChartHitKind, Vector2, Rect, Color)”public ChartHitResult(int markIndex, ChartHitKind kind, Vector2 position, Rect bounds, Color color)Creates a shape-aware 2D hit result.
Parameters
| Name | Type |
|---|---|
markIndex | System.Int32 |
kind | ChartGuru.ChartHitKind |
position | UnityEngine.Vector2 |
bounds | UnityEngine.Rect |
color | UnityEngine.Color |
ChartHitResult(int, ChartHitKind, Vector2, Rect, Color, Vector3, float, DataPoint3D)
Section titled “ChartHitResult(int, ChartHitKind, Vector2, Rect, Color, Vector3, float, DataPoint3D)”public ChartHitResult(int markIndex, ChartHitKind kind, Vector2 position, Rect bounds, Color color, Vector3 worldPosition, float distance, DataPoint3D value)Creates a 3D hit result with the world point, ray distance and data value under the pointer.
Parameters
| Name | Type |
|---|---|
markIndex | System.Int32 |
kind | ChartGuru.ChartHitKind |
position | UnityEngine.Vector2 |
bounds | UnityEngine.Rect |
color | UnityEngine.Color |
worldPosition | UnityEngine.Vector3 |
distance | System.Single |
value | ChartGuru.DataPoint3D |
Properties
Section titled “Properties”
public static ChartHitResult None { get; }A reusable invalid hit value.
Returns
ChartGuru.ChartHitResult
MarkIndex
Section titled “MarkIndex”public int MarkIndex { get; }Index of the hit mark in Chart.Marks; -1 for hits on the plot of a 3D chart.
Returns
System.Int32
public ChartHitKind Kind { get; }Kind of rendered geometry that was hit.
Returns
ChartGuru.ChartHitKind
Position
Section titled “Position”public Vector2 Position { get; }Preferred tooltip anchor in the host’s surface pixels.
Returns
UnityEngine.Vector2
Bounds
Section titled “Bounds”public Rect Bounds { get; }Rendered mark bounds in surface pixels when known.
Returns
UnityEngine.Rect
public Color Color { get; }Rendered mark color when known.
Returns
UnityEngine.Color
WorldPosition
Section titled “WorldPosition”public Vector3 WorldPosition { get; }World-space point that was hit on a 3D chart.
Returns
UnityEngine.Vector3
Distance
Section titled “Distance”public float Distance { get; }Distance from the pointer ray’s origin to ChartHitResult.WorldPosition.
Returns
System.Single
public DataPoint3D Value { get; }Data value under the pointer on a 3D chart: the mark’s value, or the interpolated surface or plot value.
Returns
ChartGuru.DataPoint3D
HasWorldPosition
Section titled “HasWorldPosition”public bool HasWorldPosition { get; }True for hits on 3D charts, which carry ChartHitResult.WorldPosition, ChartHitResult.Distance and ChartHitResult.Value.
Returns
System.Boolean
IsValid
Section titled “IsValid”public bool IsValid { get; }True when this result refers to a rendered mark.
Returns
System.Boolean