Skip to content

DataPoint

StructChartGuruChartGuru
public struct DataPoint

A single data point for chart rendering. Blittable struct optimized for GPU upload. Size: 32 bytes for cache-line friendly layout.

public float X

X-axis Value (primary axis).

Returns

System.Single

public float Y

Y-axis Value (value axis).

Returns

System.Single

public float XEnd

Optional X-end for range data (Gantt charts, range bars).

Returns

System.Single

public float YEnd

Optional Y-end for range data.

Returns

System.Single

public int SeriesIndex

Series index for multi-series charts (assigned during grouping).

Returns

System.Int32

public int Id

Unique identifier for animation stability. Auto-generated if not provided.

Returns

System.Int32

public int CategoryIndex

Category index for categorical X values.

Returns

System.Int32

public DataPoint(float x, float y)

Creates a scalar XY point whose end coordinates match its start and whose stable identity is derived from both values.

Parameters

Name Type
x System.Single
y System.Single
public DataPoint(float x, float y, int id)

Creates a scalar XY point with a caller-controlled identity for stable animation matching.

Parameters

Name Type
x System.Single
y System.Single
id System.Int32
public DataPoint(float x, float y, float xEnd, float yEnd)

Creates a two-dimensional range point and derives its stable identity from all four boundaries.

Parameters

Name Type
x System.Single
y System.Single
xEnd System.Single
yEnd System.Single

public readonly bool Equals(DataPoint other)

Parameters

Name Type
other ChartGuru.DataPoint

Returns

System.Boolean

public override readonly bool Equals(object obj)

Parameters

Name Type
obj System.Object

Returns

System.Boolean

public override readonly int GetHashCode()

Returns

System.Int32

public static DataPoint Lerp(DataPoint a, DataPoint b, float t)

Linearly interpolates between two data points.

Parameters

Name Type
a ChartGuru.DataPoint
b ChartGuru.DataPoint
t System.Single

Returns

ChartGuru.DataPoint

public override readonly string ToString()

Returns

System.String

public static bool operator ==(DataPoint left, DataPoint right)

Reports whether both points have the same stable identity hash.

Parameters

Name Type
left ChartGuru.DataPoint
right ChartGuru.DataPoint

Returns

System.Boolean

public static bool operator !=(DataPoint left, DataPoint right)

Reports whether the points have different stable identity hashes.

Parameters

Name Type
left ChartGuru.DataPoint
right ChartGuru.DataPoint

Returns

System.Boolean

public readonly bool IsRange { get; }

Whether this point represents a range (has different start/end).

Returns

System.Boolean

public readonly float2 Position { get; }

Gets the position as a float2 (X, Y).

Returns

Unity.Mathematics.float2

public readonly float2 EndPosition { get; }

Gets the end position for range data as a float2.

Returns

Unity.Mathematics.float2

public readonly float2 CenterPosition { get; }

Gets the center position for range data.

Returns

Unity.Mathematics.float2

public readonly float Width { get; }

Gets the width of the range (XEnd - X).

Returns

System.Single

public readonly float Height { get; }

Gets the height of the range (YEnd - Y).

Returns

System.Single