Skip to content

ChartMark

ClassChartGuruChartGuru
public abstract class ChartMark : IChartMark

Base implementation for marks, providing shared data, style, annotation, accessibility, stacking, and morph metadata.

protected DataPoint _dataPoint

Returns

ChartGuru.DataPoint

protected Color _foregroundColor

Returns

UnityEngine.Color

protected bool _visible

Returns

System.Boolean

protected object _seriesKey

Returns

System.Object

protected AnnotationConfig _annotation

Returns

ChartGuru.AnnotationConfig

protected float _opacity

Returns

System.Single

protected object _foregroundStyleKey

Returns

System.Object

protected LinearGradientStyle _foregroundGradient

Returns

ChartGuru.LinearGradientStyle

protected GradientStyle _foregroundGradientStyle

Returns

ChartGuru.GradientStyle

protected string _categoryLabel

Returns

System.String

protected Vector2 _offset

Returns

UnityEngine.Vector2

protected bool _showShadow

Returns

System.Boolean

protected Color _shadowColor

Returns

UnityEngine.Color

protected Vector2 _shadowOffset

Returns

UnityEngine.Vector2

protected float _shadowBlur

Returns

System.Single

protected MarkBlendMode _blendMode

Returns

ChartGuru.MarkBlendMode

protected ClipShape _clipShape

Returns

ChartGuru.ClipShape

protected float _blurRadius

Returns

System.Single

protected IChartContent _maskContent

Returns

ChartGuru.IChartContent

protected bool _compositingLayer

Returns

System.Boolean

protected RangedOffset? _rangedOffset

Returns

System.Nullable{ChartGuru.RangedOffset}

protected MarkAxis _positionAxis

Returns

ChartGuru.MarkAxis

protected int _zIndex

Returns

System.Int32

protected ChartMark()

protected ChartMark(float x, float y)

Initializes the mark with a scalar XY point whose stable identity is derived from its coordinates.

Parameters

Name Type
x System.Single
y System.Single
protected ChartMark(DataPoint dataPoint)

Initializes the mark from an existing point, preserving range, series, identity, and category metadata.

Parameters

Name Type
dataPoint ChartGuru.DataPoint

public abstract (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 abstract IChartMark Clone()

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

Returns

ChartGuru.IChartMark

public int ZIndex { get; set; }

Render order hint: marks with higher ChartGuru.ChartMark.ZIndex draw on top of marks with lower values. Renderers apply a stable sort by (SeriesIndex, ZIndex, insertion) before emit. Swift Charts equivalent: .ZIndex(Int).

Returns

System.Int32

public RangedOffset? RangedOffset { get; set; }

Optional range-based offset. When set, the mark’s resolved screen position is adjusted so that its X stretches from xStart to xEnd and its Y from yStart to yEnd (in plot/domain units), instead of using the scalar ChartGuru.ChartMark.Offset. Swift Charts equivalent (iOS 17): .Offset(xStart:xEnd:yStart:yEnd:).

Returns

System.Nullable{ChartGuru.RangedOffset}

public MarkAxis PositionAxis { get; set; }

The axis along which ChartGuru.ChartMark.SeriesKey-based positioning (dodging / grouping) is applied. When ChartGuru.MarkAxis.Automatic, layout derives the axis from the mark type (bars dodge along the categorical axis, etc.). Swift Charts equivalent: .Position(by: .Value(…), axis: .horizontal).

Returns

ChartGuru.MarkAxis

public MarkDimension? PositionSpan { get; set; }

Per-dodge-slot dimension override. When set, layout uses this dimension for the slot width assigned to this mark inside its ChartGuru.ChartMark.PositionAxis dodge group instead of the mark’s own Width/Height. Swift Charts equivalent: .Position(by:axis:span:).

Returns

System.Nullable{ChartGuru.MarkDimension}

public abstract ChartType MarkType { get; }

Returns

ChartGuru.ChartType

public virtual DataPoint DataPoint { get; set; }

Returns

ChartGuru.DataPoint

public Color ForegroundColor { get; set; }

Returns

UnityEngine.Color

public bool Visible { get; set; }

Returns

System.Boolean

public object SeriesKey { get; set; }

Returns

System.Object

public AccessibilityInfo Accessibility { get; set; }

Per-mark accessibility metadata. Swift Charts equivalent: .accessibilityLabel, .accessibilityValue, .accessibilityHidden, .accessibilityIdentifier.

Returns

ChartGuru.AccessibilityInfo

public string CategoryLabel { get; set; }

Category label for X-axis display (e.g., “Jan”, “Feb”, “Mar”). Separate from SeriesKey/ForegroundStyleKey which determine colors and legend.

Returns

System.String

public object ForegroundStyleKey { get; set; }

Key for automatic color assignment and legend generation. Swift Charts equivalent: ForegroundStyle(by:) modifier.

Returns

System.Object

public LinearGradientStyle ForegroundGradient { get; set; }

Returns

ChartGuru.LinearGradientStyle

public GradientStyle ForegroundGradientStyle { get; set; }

General gradient style (radial, angular, elliptical, or linear via the base type). When set, takes precedence over ChartGuru.ChartMark.ForegroundGradient.

Returns

ChartGuru.GradientStyle

public bool ShowShadow { get; set; }

Returns

System.Boolean

public Color ShadowColor { get; set; }

Returns

UnityEngine.Color

public Vector2 ShadowOffset { get; set; }

Returns

UnityEngine.Vector2

public float ShadowBlur { get; set; }

Returns

System.Single

public MarkBlendMode BlendMode { get; set; }

Returns

ChartGuru.MarkBlendMode

public ClipShape ClipShape { get; set; }

Returns

ChartGuru.ClipShape

public float BlurRadius { get; set; }

Returns

System.Single

public IChartContent MaskContent { get; set; }

Returns

ChartGuru.IChartContent

public bool CompositingLayer { get; set; }

Returns

System.Boolean

public Func<Rect, Color, bool> CustomSymbolRenderer { get; set; }

Custom symbol renderer callback. When set and the mark’s symbol shape is ChartGuru.SymbolShape.Custom, the renderer invokes this delegate instead of drawing a predefined shape. The callback receives the symbol’s bounding UnityEngine.Rect (in pixels) and the resolved UnityEngine.Color; it should emit geometry through the active draw sink. Return true if the symbol was drawn, false to fall back to default. Swift Charts equivalent: .Symbol() { custom View }.

Returns

System.Func{UnityEngine.Rect,UnityEngine.Color,System.Boolean}

public AnnotationConfig Annotation { get; }

Returns

ChartGuru.AnnotationConfig

public float Opacity { get; set; }

Returns

System.Single

public Vector2 Offset { get; }

Offset applied to the mark in plot coordinates. Swift Charts equivalent: .Offset(x:y:)

Returns

UnityEngine.Vector2