Skip to content

IChartTextRenderer

InterfaceChartGuruChartGuru
public interface IChartTextRenderer

Canvas label renderer used by Chart Guru's uGUI surface.

void SetParent(Transform parent, bool worldPositionStays = false)

Sets the parent transform for this text renderer.

Parameters

NameType
parentUnityEngine.Transform
worldPositionStaysSystem.Boolean
void SetPosition(Vector2 position)

Sets the anchored position within the parent RectTransform.

Parameters

NameType
positionUnityEngine.Vector2
void SetRotation(float angleDegrees)

Sets the local rotation of the text.

Parameters

NameType
angleDegreesSystem.Single
void SetAnchor(Vector2 anchorMin, Vector2 anchorMax)

Sets the anchor preset for positioning.

Parameters

NameType
anchorMinUnityEngine.Vector2
anchorMaxUnityEngine.Vector2
void SetPivot(Vector2 pivot)

Sets the pivot point for rotation and positioning.

Parameters

NameType
pivotUnityEngine.Vector2
void ApplyOptions(ChartTextOptions options)

Applies text options from configuration.

Parameters

NameType
optionsChartGuru.ChartTextOptions
Vector2 GetPreferredSize()

Gets the preferred size of the text based on current content and settings.

Returns

UnityEngine.Vector2

float GetPreferredWidth(string text)

Gets the preferred width for a given string without changing the current text.

Parameters

NameType
textSystem.String

Returns

System.Single

void Destroy()

Destroys the underlying GameObject.

GameObject GameObject { get; }

The underlying GameObject containing the text component.

Returns

UnityEngine.GameObject

RectTransform RectTransform { get; }

The RectTransform of the text component.

Returns

UnityEngine.RectTransform

string Text { get; set; }

Gets or sets the text content.

Returns

System.String

float FontSize { get; set; }

Gets or sets the font size.

Returns

System.Single

Color Color { get; set; }

Gets or sets the text color.

Returns

UnityEngine.Color

ChartTextAlignment Alignment { get; set; }

Gets or sets the text alignment.

Returns

ChartGuru.ChartTextAlignment

bool IsActive { get; set; }

Gets or sets whether the text is active/visible.

Returns

System.Boolean

bool IsValid { get; }

Returns true if the underlying GameObject is still valid (not destroyed).

Returns

System.Boolean