Skip to content

RectangleMark

ClassChartGuruChartGuru
public class RectangleMark : ChartMark, IChartMark

RectangleMark for heatmaps, range charts, and grid-based visualizations. Matches Swift Charts RectangleMark(xStart:xEnd:yStart:yEnd:) API.

public RectangleMark()

public RectangleMark(float x, float y)

Creates a RectangleMark centered at an XY point. Matches Swift Charts: RectangleMark(x:y:width:height:). Width/height are controlled through ChartGuru.RectangleMark.Width(ChartGuru.MarkDimension) and ChartGuru.RectangleMark.Height(ChartGuru.MarkDimension).

Parameters

Name Type
x System.Single
y System.Single

RectangleMark(PlottableValueRef, PlottableValueRef, int)

Section titled “RectangleMark(PlottableValueRef, PlottableValueRef, int)”
public RectangleMark(PlottableValueRef x, PlottableValueRef y, int index = 0)

Creates a centered RectangleMark from Swift-style plottable x/y bindings.

Parameters

Name Type
x ChartGuru.PlottableValueRef
y ChartGuru.PlottableValueRef
index System.Int32
public RectangleMark(float xStart, float xEnd, float yStart, float yEnd)

Creates a RectangleMark with explicit bounds. Matches Swift Charts: RectangleMark(xStart:xEnd:yStart:yEnd:)

Parameters

Name Type
xStart System.Single
xEnd System.Single
yStart System.Single
yEnd System.Single

RectangleMark(PlottableValueRef, PlottableValueRef, PlottableValueRef, PlottableValueRef)

Section titled “RectangleMark(PlottableValueRef, PlottableValueRef, PlottableValueRef, PlottableValueRef)”
public RectangleMark(PlottableValueRef xStart, PlottableValueRef xEnd, PlottableValueRef yStart, PlottableValueRef yEnd)

Creates a RectangleMark with categorical PlottableValue bounds. Matches Swift Charts: RectangleMark(xStart: .Value(…), xEnd: .Value(…), yStart: .Value(…), yEnd: .Value(…)) Positions are resolved automatically by ChartBuilder from unique category order.

Parameters

Name Type
xStart ChartGuru.PlottableValueRef
xEnd ChartGuru.PlottableValueRef
yStart ChartGuru.PlottableValueRef
yEnd ChartGuru.PlottableValueRef

public static RectangleMark FromRect(float x, float y, float width, float height)

Creates a RectangleMark from position and Size (convenience constructor).

Parameters

Name Type
x System.Single
y System.Single
width System.Single
height System.Single

Returns

ChartGuru.RectangleMark

public static RectangleMark FromCenter(float centerX, float centerY, float width, float height)

Creates a RectangleMark centered at position with given size.

Parameters

Name Type
centerX System.Single
centerY System.Single
width System.Single
height System.Single

Returns

ChartGuru.RectangleMark

public RectangleMark CornerRadius(float radius)

Sets the corner radius for this rectangle. Swift Charts equivalent: .ClipShape(.rect(cornerRadius:))

Parameters

Name Type
radius System.Single

Returns

ChartGuru.RectangleMark

public RectangleMark CellPadding(float padding)

Sets the cell Padding (0–10 percent of cell size on each side) for this rectangle. Matches the designer’s Heat Map cell padding slider.

Parameters

Name Type
padding System.Single

Returns

ChartGuru.RectangleMark

public RectangleMark Width(MarkDimension dimension)

Sets the rendered rectangle width with Swift Charts MarkDimension semantics. Equivalent to RectangleMark(…, width: .fixed/.ratio/.inset/.automatic).

Parameters

Name Type
dimension ChartGuru.MarkDimension

Returns

ChartGuru.RectangleMark

public RectangleMark Height(MarkDimension dimension)

Sets the rendered rectangle height with Swift Charts MarkDimension semantics. Equivalent to RectangleMark(…, height: .fixed/.ratio/.inset/.automatic).

Parameters

Name Type
dimension ChartGuru.MarkDimension

Returns

ChartGuru.RectangleMark

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 Rectangle Mark; later configuration changes do not affect the original instance.

Returns

ChartGuru.IChartMark

public override ChartType MarkType { get; }

Returns

ChartGuru.ChartType

public bool NeedsCategoricalResolution { get; }

When true, this mark was created with categorical PlottableValue bounds and needs position resolution by ChartBuilder.

Returns

System.Boolean

public bool IsCentered { get; }

True when authored with Swift Charts’ centered RectangleMark(x:y:width:height:) form instead of range bounds.

Returns

System.Boolean

public float XStart { get; set; }

Left X coordinate of the rectangle.

Returns

System.Single

public float XEnd { get; set; }

Right X coordinate of the rectangle.

Returns

System.Single

public float YStart { get; set; }

Bottom Y coordinate of the rectangle.

Returns

System.Single

public float YEnd { get; set; }

Top Y coordinate of the rectangle.

Returns

System.Single

public float CornerRadiusValue { get; set; }

Corner radius for rounded rectangles.

Returns

System.Single

public float CellPaddingPercent { get; set; }

Cell padding as a percentage (0–10) of cell screen size on each side. Applied by the renderer at draw time; does not modify the data-space coordinates. Matches the Designer’s _heatMapCellPadding semantics.

Returns

System.Single

public Color StrokeColor { get; set; }

Stroke/border color.

Returns

UnityEngine.Color

public float StrokeWidth { get; set; }

Stroke/border width.

Returns

System.Single

public MarkDimension WidthDimension { get; set; }

Optional Swift Charts MarkDimension width override. This does not replace ChartGuru.RectangleMark.DataWidth, which remains the data-space rectangle extent.

Returns

ChartGuru.MarkDimension

public MarkDimension HeightDimension { get; set; }

Optional Swift Charts MarkDimension height override. This does not replace ChartGuru.RectangleMark.DataHeight, which remains the data-space rectangle extent.

Returns

ChartGuru.MarkDimension

public float DataWidth { get; }

Data-space width of the rectangle (XEnd - XStart).

Returns

System.Single

public float DataHeight { get; }

Data-space height of the rectangle (YEnd - YStart).

Returns

System.Single

public float CenterX { get; }

Center X coordinate.

Returns

System.Single

public float CenterY { get; }

Center Y coordinate.

Returns

System.Single