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 RectangleMark.Width(MarkDimension) and RectangleMark.Height(MarkDimension).

Parameters

NameType
xSystem.Single
ySystem.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

NameType
xChartGuru.PlottableValueRef
yChartGuru.PlottableValueRef
indexSystem.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

NameType
xStartSystem.Single
xEndSystem.Single
yStartSystem.Single
yEndSystem.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 numeric, temporal, or 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

NameType
xStartChartGuru.PlottableValueRef
xEndChartGuru.PlottableValueRef
yStartChartGuru.PlottableValueRef
yEndChartGuru.PlottableValueRef

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

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

Parameters

NameType
xSystem.Single
ySystem.Single
widthSystem.Single
heightSystem.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

NameType
centerXSystem.Single
centerYSystem.Single
widthSystem.Single
heightSystem.Single

Returns

ChartGuru.RectangleMark

public RectangleMark CornerRadius(float radius)

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

Parameters

NameType
radiusSystem.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

NameType
paddingSystem.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

NameType
dimensionChartGuru.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

NameType
dimensionChartGuru.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

NameType
targetTypeChartGuru.ChartType
plotAreaUnityEngine.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 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 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