Skip to content

LeaderLineGraphic

ClassChartGuruChartGuru
[RequireComponent(typeof(CanvasRenderer))]
public class LeaderLineGraphic : Graphic

UI Graphic component for rendering leader lines connecting pie labels to slices. Uses Unity’s UI mesh system for proper Canvas integration.

public float LineWidth { get; set; }

Width of the leader lines.

Returns

System.Single — No return description is available.

public Color LineColor { get; set; }

Default color for leader lines.

Returns

UnityEngine.Color — No return description is available.

public float DotRadius { get; set; }

Radius of the dot at the start of each line.

Returns

System.Single — No return description is available.

public bool ShowStartDot { get; set; }

Whether to show a dot at the start point.

Returns

System.Boolean — No return description is available.

protected override void Awake()

No description is available for this member.

public void SetLines(List<LeaderLineGraphic.LeaderLine> lines)

Sets the leader lines to render.

Parameters

Name Type Description
lines System.Collections.Generic.List{ChartGuru.LeaderLineGraphic.LeaderLine}
public void Clear()

Clears all leader lines.

public void AddLine(Vector2 start, Vector2 end, Color? lineColor = null)

Adds a single leader line.

Parameters

Name Type Description
start UnityEngine.Vector2
end UnityEngine.Vector2
lineColor System.Nullable{UnityEngine.Color}

AddLine(Vector2, Vector2, Vector2, Color?)

Section titled “AddLine(Vector2, Vector2, Vector2, Color?)”
public void AddLine(Vector2 start, Vector2 elbow, Vector2 end, Color? lineColor = null)

Adds a leader line with an elbow point.

Parameters

Name Type Description
start UnityEngine.Vector2
elbow UnityEngine.Vector2
end UnityEngine.Vector2
lineColor System.Nullable{UnityEngine.Color}
public void SetFromPositionedLabels(List<RadialLabelPositioner.PositionedLabel> labels)

Creates leader lines from positioned labels.

Parameters

Name Type Description
labels System.Collections.Generic.List{ChartGuru.RadialLabelPositioner.PositionedLabel}
protected override void OnPopulateMesh(VertexHelper vh)

Callback function when a UI element needs to generate vertices. Fills the vertex buffer data.

Parameters

Name Type Description
vh UnityEngine.UI.VertexHelper VertexHelper utility.

Remarks

Used by Text, UI.Image, and RawImage for example to generate vertices specific to their use case.