Skip to content

RuleMark

ClassChartGuruChartGuru
public class RuleMark : ChartMark, IChartMark

Represents a horizontal or vertical reference rule spanning a chart domain or explicit range.

public RuleMark()

public static RuleMark Horizontal(float yValue)

Creates a horizontal rule spanning the plot area at the specified Y-axis value.

Parameters

Name Type
yValue System.Single

Returns

ChartGuru.RuleMark

public static RuleMark Vertical(float xValue)

Creates a vertical rule spanning the plot area at the specified X-axis value.

Parameters

Name Type
xValue System.Single

Returns

ChartGuru.RuleMark

public static RuleMark VerticalSegment(float xValue, float yMin, float yMax)

Creates a vertical segment rule from yMin to yMax at the given X value. Useful for candlestick wicks.

Parameters

Name Type
xValue System.Single
yMin System.Single
yMax System.Single

Returns

ChartGuru.RuleMark

public static RuleMark HorizontalSegment(float yValue, float xMin, float xMax)

Creates a horizontal segment rule from xMin to xMax at the given Y value.

Parameters

Name Type
yValue System.Single
xMin System.Single
xMax System.Single

Returns

ChartGuru.RuleMark

public RuleMark LineStyle(float width)

Sets the line width for this rule. Swift Charts equivalent: .LineStyle(StrokeStyle(lineWidth:))

Parameters

Name Type
width System.Single

Returns

ChartGuru.RuleMark

public RuleMark LineStyle(float[] dashPattern)

Sets a dashed line style. Swift Charts equivalent: .LineStyle(StrokeStyle(dash:))

Parameters

Name Type
dashPattern System.Single[]

Returns

ChartGuru.RuleMark

public RuleMark LineStyle(StrokeStyle style)

Sets the full stroke style, including width and dash pattern. Swift Charts equivalent: .LineStyle(StrokeStyle(lineWidth:dash:)).

Parameters

Name Type
style ChartGuru.StrokeStyle

Returns

ChartGuru.RuleMark

public override (Vector2 source, Vector2 target) GetMorphTargets(ChartType targetType, Rect plotArea)

Projects this mark into plot-space geometry that the morph renderer can interpolate toward the requested chart type.

Parameters

Name Type
targetType ChartGuru.ChartType
plotArea UnityEngine.Rect

Returns

System.ValueTuple{UnityEngine.Vector2,UnityEngine.Vector2}

public override IChartMark Clone()

Creates an independent copy of this Rule Mark; later configuration changes do not affect the original instance.

Returns

ChartGuru.IChartMark

public override ChartType MarkType { get; }

Returns

ChartGuru.ChartType

public bool IsHorizontal { get; set; }

Whether this is a horizontal (Y-value) or vertical (X-value) rule line.

Returns

System.Boolean

public float Value { get; set; }

Returns

System.Single

public float LineWidth { get; set; }

Returns

System.Single

public float[] DashPattern { get; set; }

Returns

System.Single[]

public string Label { get; set; }

Returns

System.String

public bool ShowLabel { get; set; }

Returns

System.Boolean

public float? SecondaryMin { get; set; }

For segment-based rules: the minimum value on the secondary axis. For a vertical rule, this is the Y minimum. For a horizontal rule, this is the X minimum. When set, the rule becomes a line segment instead of spanning the full axis.

Returns

System.Nullable{System.Single}

public float? SecondaryMax { get; set; }

For segment-based rules: the maximum value on the secondary axis.

Returns

System.Nullable{System.Single}

public bool IsSegment { get; }

Whether this rule is a segment (has both min and max defined).

Returns

System.Boolean

public bool IsDashed { get; }

Returns

System.Boolean