Skip to content

Chart

ClassChartGuruChartGuru
public class Chart

Represents a fully configured chart, including its marks, axes, theme, layout, interaction state, and animation settings. Create charts through ChartGuru.ChartBuilder for the fluent authoring workflow, or configure this model directly for advanced scenarios.

public bool IsDirty(DirtyFlags flags)

Reports whether any requested dirty flag is set, indicating that the corresponding chart state must be recalculated or rendered.

Parameters

Name Type
flags ChartGuru.DirtyFlags

Returns

System.Boolean

public static ChartBuilder Create()

Creates an empty fluent builder for composing marks and chart-wide presentation.

Returns

ChartGuru.ChartBuilder

public static ChartBuilder Create<T>(IEnumerable<T> data, Func<T, IChartMark> markFactory)

Enumerates the source immediately and appends one factory-created mark per item to a new builder.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
markFactory System.Func{{T},ChartGuru.IChartMark}

Returns

ChartGuru.ChartBuilder

public static ChartBuilder Create<T>(IEnumerable<T> data, Func<T, IEnumerable<IChartMark>> markFactory)

Enumerates the source immediately and appends each non-null mark sequence returned for an item.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
markFactory System.Func{{T},System.Collections.Generic.IEnumerable{ChartGuru.IChartMark}}

Returns

ChartGuru.ChartBuilder

Create(IEnumerable, Func<T, int, IChartMark>)

Section titled “Create(IEnumerable, Func<T, int, IChartMark>)”
public static ChartBuilder Create<T>(IEnumerable<T> data, Func<T, int, IChartMark> markFactory)

Enumerates the source immediately and passes each item with its zero-based index to a one-mark factory.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
markFactory System.Func{{T},System.Int32,ChartGuru.IChartMark}

Returns

ChartGuru.ChartBuilder

Create<T, TMark>(IEnumerable, Func<T, TMark>)

Section titled “Create<T, TMark>(IEnumerable, Func<T, TMark>)”
public static ChartBuilder Create<T, TMark>(IEnumerable<T> data, Func<T, TMark> markFactory) where TMark : IChartMark

Creates a builder by projecting every source item into a strongly typed chart mark.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
markFactory System.Func{{T},{TMark}}

Returns

ChartGuru.ChartBuilder

Create<T, TMark>(IEnumerable, Func<T, int, TMark>)

Section titled “Create<T, TMark>(IEnumerable, Func<T, int, TMark>)”
public static ChartBuilder Create<T, TMark>(IEnumerable<T> data, Func<T, int, TMark> markFactory) where TMark : IChartMark

Creates a builder by projecting each source item and zero-based index into a strongly typed chart mark.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
markFactory System.Func{{T},System.Int32,{TMark}}

Returns

ChartGuru.ChartBuilder

public static ChartBuilder CreateCompact(ChartType type = ChartType.Sparkline)

Creates a compact chart (sparkline, mini bar, etc.) with a fluent builder.

Parameters

Name Type Description
type ChartGuru.ChartType The compact chart type (Sparkline, Trend, MiniBar, MiniPie, MiniDonut, Indicator).

Returns

ChartGuru.ChartBuilder

CreateBars(IEnumerable, Func<T, float>, Func<T, string>, Action<BarMark, T, int>)

Section titled “CreateBars(IEnumerable, Func<T, float>, Func<T, string>, Action<BarMark, T, int>)”
public static ChartBuilder CreateBars<T>(IEnumerable<T> data, Func<T, float> ySelector, Func<T, string> categoryLabelSelector, Action<BarMark, T, int> configure = null)

Creates a vertical bar builder using source order for X positions, selected Y values, and selected category labels.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
ySelector System.Func{{T},System.Single}
categoryLabelSelector System.Func{{T},System.String}
configure System.Action{ChartGuru.BarMark,{T},System.Int32}

Returns

ChartGuru.ChartBuilder

CreateBars(IEnumerable, Func<T, float>, Func<T, float>, Action<BarMark, T>)

Section titled “CreateBars(IEnumerable, Func<T, float>, Func<T, float>, Action<BarMark, T>)”
public static ChartBuilder CreateBars<T>(IEnumerable<T> data, Func<T, float> xSelector, Func<T, float> ySelector, Action<BarMark, T> configure = null)

Creates a bar builder from numeric X/Y projections and optionally customizes each generated mark.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
xSelector System.Func{{T},System.Single}
ySelector System.Func{{T},System.Single}
configure System.Action{ChartGuru.BarMark,{T}}

Returns

ChartGuru.ChartBuilder

CreateBars(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<BarMark, T>)

Section titled “CreateBars(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<BarMark, T>)”
public static ChartBuilder CreateBars<T>(IEnumerable<T> data, Func<T, PlottableValueRef> xSelector, Func<T, PlottableValueRef> ySelector, Func<T, PlottableValueRef> seriesSelector = null, Action<BarMark, T> configure = null)

Creates a bar builder from semantic X/Y projections, inferring categorical orientation and optional series grouping.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
xSelector System.Func{{T},ChartGuru.PlottableValueRef}
ySelector System.Func{{T},ChartGuru.PlottableValueRef}
seriesSelector System.Func{{T},ChartGuru.PlottableValueRef}
configure System.Action{ChartGuru.BarMark,{T}}

Returns

ChartGuru.ChartBuilder

CreateLine(IEnumerable, Func<T, float>, Func<T, string>, Action<LineMark, T, int>)

Section titled “CreateLine(IEnumerable, Func<T, float>, Func<T, string>, Action<LineMark, T, int>)”
public static ChartBuilder CreateLine<T>(IEnumerable<T> data, Func<T, float> ySelector, Func<T, string> categoryLabelSelector, Action<LineMark, T, int> configure = null)

Creates a line builder using source order for X positions, selected Y values, and selected category labels.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
ySelector System.Func{{T},System.Single}
categoryLabelSelector System.Func{{T},System.String}
configure System.Action{ChartGuru.LineMark,{T},System.Int32}

Returns

ChartGuru.ChartBuilder

CreateLine(IEnumerable, Func<T, float>, Func<T, float>, Action<LineMark, T>)

Section titled “CreateLine(IEnumerable, Func<T, float>, Func<T, float>, Action<LineMark, T>)”
public static ChartBuilder CreateLine<T>(IEnumerable<T> data, Func<T, float> xSelector, Func<T, float> ySelector, Action<LineMark, T> configure = null)

Creates a line builder from numeric X/Y projections and optionally customizes each generated mark.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
xSelector System.Func{{T},System.Single}
ySelector System.Func{{T},System.Single}
configure System.Action{ChartGuru.LineMark,{T}}

Returns

ChartGuru.ChartBuilder

CreateLine(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<LineMark, T>)

Section titled “CreateLine(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<LineMark, T>)”
public static ChartBuilder CreateLine<T>(IEnumerable<T> data, Func<T, PlottableValueRef> xSelector, Func<T, PlottableValueRef> ySelector, Func<T, PlottableValueRef> seriesSelector = null, Action<LineMark, T> configure = null)

Creates a line builder from semantic X/Y projections with optional series grouping and per-mark customization.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
xSelector System.Func{{T},ChartGuru.PlottableValueRef}
ySelector System.Func{{T},ChartGuru.PlottableValueRef}
seriesSelector System.Func{{T},ChartGuru.PlottableValueRef}
configure System.Action{ChartGuru.LineMark,{T}}

Returns

ChartGuru.ChartBuilder

CreatePoints(IEnumerable, Func<T, float>, Func<T, string>, Action<PointMark, T, int>)

Section titled “CreatePoints(IEnumerable, Func<T, float>, Func<T, string>, Action<PointMark, T, int>)”
public static ChartBuilder CreatePoints<T>(IEnumerable<T> data, Func<T, float> ySelector, Func<T, string> categoryLabelSelector, Action<PointMark, T, int> configure = null)

Creates a point-chart builder using source order for X positions, selected Y values, and category labels.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
ySelector System.Func{{T},System.Single}
categoryLabelSelector System.Func{{T},System.String}
configure System.Action{ChartGuru.PointMark,{T},System.Int32}

Returns

ChartGuru.ChartBuilder

CreatePoints(IEnumerable, Func<T, float>, Func<T, float>, Action<PointMark, T>)

Section titled “CreatePoints(IEnumerable, Func<T, float>, Func<T, float>, Action<PointMark, T>)”
public static ChartBuilder CreatePoints<T>(IEnumerable<T> data, Func<T, float> xSelector, Func<T, float> ySelector, Action<PointMark, T> configure = null)

Creates a point-chart builder from numeric X/Y projections and optionally customizes each point mark.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
xSelector System.Func{{T},System.Single}
ySelector System.Func{{T},System.Single}
configure System.Action{ChartGuru.PointMark,{T}}

Returns

ChartGuru.ChartBuilder

CreatePoints(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<PointMark, T>)

Section titled “CreatePoints(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<PointMark, T>)”
public static ChartBuilder CreatePoints<T>(IEnumerable<T> data, Func<T, PlottableValueRef> xSelector, Func<T, PlottableValueRef> ySelector, Func<T, PlottableValueRef> seriesSelector = null, Action<PointMark, T> configure = null)

Creates a point-chart builder from semantic X/Y projections with optional series grouping.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
xSelector System.Func{{T},ChartGuru.PlottableValueRef}
ySelector System.Func{{T},ChartGuru.PlottableValueRef}
seriesSelector System.Func{{T},ChartGuru.PlottableValueRef}
configure System.Action{ChartGuru.PointMark,{T}}

Returns

ChartGuru.ChartBuilder

CreateArea(IEnumerable, Func<T, float>, Func<T, string>, Action<AreaMark, T, int>)

Section titled “CreateArea(IEnumerable, Func<T, float>, Func<T, string>, Action<AreaMark, T, int>)”
public static ChartBuilder CreateArea<T>(IEnumerable<T> data, Func<T, float> ySelector, Func<T, string> categoryLabelSelector, Action<AreaMark, T, int> configure = null)

Creates an area-chart builder using source order for X positions, selected Y values, and category labels.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
ySelector System.Func{{T},System.Single}
categoryLabelSelector System.Func{{T},System.String}
configure System.Action{ChartGuru.AreaMark,{T},System.Int32}

Returns

ChartGuru.ChartBuilder

CreateArea(IEnumerable, Func<T, float>, Func<T, float>, Action<AreaMark, T>)

Section titled “CreateArea(IEnumerable, Func<T, float>, Func<T, float>, Action<AreaMark, T>)”
public static ChartBuilder CreateArea<T>(IEnumerable<T> data, Func<T, float> xSelector, Func<T, float> ySelector, Action<AreaMark, T> configure = null)

Creates an area-chart builder from numeric X/Y projections and optionally customizes each area mark.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
xSelector System.Func{{T},System.Single}
ySelector System.Func{{T},System.Single}
configure System.Action{ChartGuru.AreaMark,{T}}

Returns

ChartGuru.ChartBuilder

CreateArea(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<AreaMark, T>)

Section titled “CreateArea(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<AreaMark, T>)”
public static ChartBuilder CreateArea<T>(IEnumerable<T> data, Func<T, PlottableValueRef> xSelector, Func<T, PlottableValueRef> ySelector, Func<T, PlottableValueRef> seriesSelector = null, Action<AreaMark, T> configure = null)

Creates an area-chart builder from semantic X/Y projections with optional series grouping.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
xSelector System.Func{{T},ChartGuru.PlottableValueRef}
ySelector System.Func{{T},ChartGuru.PlottableValueRef}
seriesSelector System.Func{{T},ChartGuru.PlottableValueRef}
configure System.Action{ChartGuru.AreaMark,{T}}

Returns

ChartGuru.ChartBuilder

CreateArea(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<AreaMark, T>)

Section titled “CreateArea(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<AreaMark, T>)”
public static ChartBuilder CreateArea<T>(IEnumerable<T> data, Func<T, PlottableValueRef> xSelector, Func<T, PlottableValueRef> yStartSelector, Func<T, PlottableValueRef> yEndSelector, Func<T, PlottableValueRef> seriesSelector = null, Action<AreaMark, T> configure = null)

Creates a ranged area builder whose selected lower and upper Y values bound the fill for each X value.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
xSelector System.Func{{T},ChartGuru.PlottableValueRef}
yStartSelector System.Func{{T},ChartGuru.PlottableValueRef}
yEndSelector System.Func{{T},ChartGuru.PlottableValueRef}
seriesSelector System.Func{{T},ChartGuru.PlottableValueRef}
configure System.Action{ChartGuru.AreaMark,{T}}

Returns

ChartGuru.ChartBuilder

CreateSectors(IEnumerable, Func<T, float>, Func<T, string>, Action<SectorMark, T, int>)

Section titled “CreateSectors(IEnumerable, Func<T, float>, Func<T, string>, Action<SectorMark, T, int>)”
public static ChartBuilder CreateSectors<T>(IEnumerable<T> data, Func<T, float> valueSelector, Func<T, string> categoryLabelSelector, Action<SectorMark, T, int> configure = null)

Creates a pie-chart builder from selected angular values and category labels, with source-order indices passed to customization.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
valueSelector System.Func{{T},System.Single}
categoryLabelSelector System.Func{{T},System.String}
configure System.Action{ChartGuru.SectorMark,{T},System.Int32}

Returns

ChartGuru.ChartBuilder

CreateSectors(IEnumerable, Func<T, float>, Action<SectorMark, T>)

Section titled “CreateSectors(IEnumerable, Func<T, float>, Action<SectorMark, T>)”
public static ChartBuilder CreateSectors<T>(IEnumerable<T> data, Func<T, float> valueSelector, Action<SectorMark, T> configure = null)

Creates a pie-chart builder from selected angular values and optionally customizes each sector.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
valueSelector System.Func{{T},System.Single}
configure System.Action{ChartGuru.SectorMark,{T}}

Returns

ChartGuru.ChartBuilder

CreateSectors(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<SectorMark, T>)

Section titled “CreateSectors(IEnumerable, Func<T, PlottableValueRef>, Func<T, PlottableValueRef>, Action<SectorMark, T>)”
public static ChartBuilder CreateSectors<T>(IEnumerable<T> data, Func<T, PlottableValueRef> angleSelector, Func<T, PlottableValueRef> categorySelector = null, Action<SectorMark, T> configure = null)

Creates a pie-chart builder from semantic angle projections with optional categorical styling metadata.

Parameters

Name Type
data System.Collections.Generic.IEnumerable{{T}}
angleSelector System.Func{{T},ChartGuru.PlottableValueRef}
categorySelector System.Func{{T},ChartGuru.PlottableValueRef}
configure System.Action{ChartGuru.SectorMark,{T}}

Returns

ChartGuru.ChartBuilder

public float CalculateLegendHeight(float availableWidth, float scaleFactor = 1)

Calculates legend height from the current chart data, theme, and resolved layout.

Parameters

Name Type
availableWidth System.Single
scaleFactor System.Single

Returns

System.Single

public float CalculateLegendWidth(float textScaleFactor = 1, float contentScaleFactor = 1)

Calculates legend width from the current chart data, theme, and resolved layout.

Parameters

Name Type
textScaleFactor System.Single
contentScaleFactor System.Single

Returns

System.Single

public void CalculateLayout()

Resolves ChartGuru.AxisPosition.Auto on both axes to a concrete Left/Right/Top/Bottom value based on the chart type. Called once at the start of ChartGuru.Chart.CalculateLayout so every downstream consumer (layout engine, renderers, label placement) sees a resolved position.

public string GetAccessibilitySummary()

Returns the explicit accessibility label, or synthesizes a summary from the chart title, mark count, and distinct keyed series.

Returns

System.String

public IEnumerable<IChartMark> GetAccessibleMarks()

Enumerates marks that contain accessibility metadata, excluding marks explicitly hidden from assistive navigation.

Returns

System.Collections.Generic.IEnumerable{ChartGuru.IChartMark}

public void SetDimension(ChartDimension dim)

Set the chart dimension (2D or 3D). Promoted to public so add-ons (e.g. ChartGuru.3D) can flip a chart between modes and drive the 2D ↔ 3D morph recipes.

Parameters

Name Type
dim ChartGuru.ChartDimension
public void AddMark(IChartMark mark)

Adds mark to this Chart and preserves its order for subsequent chart layout.

Parameters

Name Type
mark ChartGuru.IChartMark
public void AddMarks(IEnumerable<IChartMark> marks)

Adds marks to this Chart and preserves its order for subsequent chart layout.

Parameters

Name Type
marks System.Collections.Generic.IEnumerable{ChartGuru.IChartMark}
public void ClearMarks()

Clears marks from this Chart without changing unrelated configuration.

public void SetData(IEnumerable<IChartMark> newMarks)

Updates the chart data with new marks. If ChartGuru.Chart.Animation is non-null, a smooth animation interpolates from old to new values. Matches Swift Charts: you opt in by setting chart.Animation = Animation.Default (or using ChartGuru.Chart.SetData(System.Collections.Generic.IEnumerable%7bChartGuru.IChartMark%7d%2cSystem.Nullable%7bChartGuru.Animation%7d)).

Parameters

Name Type
newMarks System.Collections.Generic.IEnumerable{ChartGuru.IChartMark}
public void SetData(IEnumerable<IChartMark> newMarks, Animation? oneShotAnimation)

Updates the chart data and animates the transition with a one-shot animation override. Equivalent to SwiftUI’s withAnimation(_:):

chart.SetData(marks, Animation.Spring());

Pass null to apply instantly regardless of ChartGuru.Chart.Animation. Note: animation only runs when transitioning between two non-empty mark sets. The very first load (previous marks were empty) snaps to its target values so that hosts like ChartGuru.ChartGraphic can opt in to the zero→values entry animation explicitly via ChartGuru.Chart.ReplayEntryAnimation(System.Nullable%7bChartGuru.Animation%7d) when their “Animate On Start” flag is set, instead of every chart implicitly animating in on launch.

Parameters

Name Type
newMarks System.Collections.Generic.IEnumerable{ChartGuru.IChartMark}
oneShotAnimation System.Nullable{ChartGuru.Animation}
public void SetValues(IEnumerable<float> newValues)

Updates the Y values of existing marks. If ChartGuru.Chart.Animation is non-null, the change is animated. The number of values must match the number of marks.

Parameters

Name Type
newValues System.Collections.Generic.IEnumerable{System.Single}
public void SetValues(IReadOnlyList<float> newValues)

Updates the Y values of existing marks without copying the source list.

Parameters

Name Type
newValues System.Collections.Generic.IReadOnlyList{System.Single}
public void SetValues(float[] newValues, int count)

Updates the first count Y values of existing marks without copying the source array.

Parameters

Name Type
newValues System.Single[]
count System.Int32
public void SetValues(IEnumerable<float> newValues, Animation? oneShotAnimation)

Animated variant with a one-shot animation override.

Parameters

Name Type
newValues System.Collections.Generic.IEnumerable{System.Single}
oneShotAnimation System.Nullable{ChartGuru.Animation}
public void SetValues(IReadOnlyList<float> newValues, Animation? oneShotAnimation)

Animated variant with a one-shot animation override.

Parameters

Name Type
newValues System.Collections.Generic.IReadOnlyList{System.Single}
oneShotAnimation System.Nullable{ChartGuru.Animation}
public void SetValues(float[] newValues, int count, Animation? oneShotAnimation)

Animated variant with a one-shot animation override.

Parameters

Name Type
newValues System.Single[]
count System.Int32
oneShotAnimation System.Nullable{ChartGuru.Animation}
public void ReplayEntryAnimation(Animation? animation = null)

Restarts the chart’s entry transition with an optional animation override, without replacing marks or data.

Parameters

Name Type
animation System.Nullable{ChartGuru.Animation}
public void SkipPendingAnimation()

Cancels any pending value animation queued by a prior ChartGuru.Chart.SetData(System.Collections.Generic.IEnumerable%7bChartGuru.IChartMark%7d) or ChartGuru.Chart.ReplayEntryAnimation(System.Nullable%7bChartGuru.Animation%7d) call so the next render snaps to the current target values instead of animating from zero / previous values. Used by component hosts to honor “Animate On Start = false” while still letting later data-change animations play normally.

public float CalculateYAxisWidth(float scaleFactor = 1)

Calculates y axis width from the current chart data, theme, and resolved layout.

Parameters

Name Type
scaleFactor System.Single

Returns

System.Single

public float CalculateXAxisLabelHeight(float scaleFactor = 1, float availableWidth = -1)

Calculates x axis label height from the current chart data, theme, and resolved layout.

Parameters

Name Type
scaleFactor System.Single
availableWidth System.Single

Returns

System.Single

public float TransformY(float rawValue)

Transforms a raw Y data value into the axis coordinate space used by ChartGuru.Chart.EffectiveYDomain and all internal layout/projection math. Identity for linear axes, log_b(value) for logarithmic axes.

Parameters

Name Type
rawValue System.Single

Returns

System.Single

public float InverseTransformY(float transformed)

Inverse of ChartGuru.Chart.TransformY(System.Single): maps an axis-space value back to raw data space. Used for tick labels and tooltip readouts on log axes.

Parameters

Name Type
transformed System.Single

Returns

System.Single

public float NormalizeY(float rawValue)

Convenience: maps a raw Y value to a [0..1] normalized position along the effective Y domain.

Parameters

Name Type
rawValue System.Single

Returns

System.Single

public void ClearSelection()

Clears the current selection.

public void MarkDirty(DirtyFlags flags)

Marks the selected data, style, layout, legend, or animation stages for recomputation before the next render.

Parameters

Name Type
flags ChartGuru.DirtyFlags
public void ClearDirty()

Clears dirty from this Chart without changing unrelated configuration.

public void ClearDirty(DirtyFlags flags)

Clears dirty from this Chart without changing unrelated configuration.

Parameters

Name Type
flags ChartGuru.DirtyFlags
public Chart MorphTo(ChartType targetType)

Begins an animated transition to the target chart, selecting a compatible semantic, scale, or cross-fade strategy.

Parameters

Name Type
targetType ChartGuru.ChartType

Returns

ChartGuru.Chart

public Chart MorphTo(ChartType targetType, MorphOptions options)

Begins an animated transition to the target chart, selecting a compatible semantic, scale, or cross-fade strategy.

Parameters

Name Type
targetType ChartGuru.ChartType
options ChartGuru.MorphOptions

Returns

ChartGuru.Chart

public void Dispose()

Releases resources owned by this Chart; callers should not use the instance afterward.

public Chart()

public bool PreserveXAxisHeightAcrossZoom { get; set; }

When true, layout caches the largest X-axis label height observed across zoom changes and uses the cached value instead of re-measuring. Prevents the plot area from shifting vertically as shorter labels appear at higher zoom levels. Swift Charts equivalent: .ChartXAxisPreserveHeightAcrossZoom(true).

Returns

System.Boolean

public bool AlignsMarkStylesWithPlotArea { get; set; }

Controls whether gradient/fill mark styles align to the plot area coordinate space (true) or to each mark’s own bounding box (false). Swift Charts equivalent: .AlignsMarkStylesWithPlotArea(Bool).

Returns

System.Boolean

public bool AccessibilityAudioGraphEnabled { get; set; }

When true, the chart participates in audio-graph / sonification accessibility export. Swift Charts equivalent: AXChartDescriptorRepresentable conformance.

Returns

System.Boolean

public ChartScrollTargetBehavior ScrollTargetBehavior { get; set; }

Snapping behavior applied when programmatic scroll APIs settle on a new origin. Swift Charts equivalent: .ChartScrollTargetBehavior(.valueAligned(…)).

Returns

ChartGuru.ChartScrollTargetBehavior

public IReadOnlyList<IChartMark> Marks { get; }

Returns

System.Collections.Generic.IReadOnlyList{ChartGuru.IChartMark}

public IReadOnlyList<IChartMark> MarksInZOrder { get; }

Returns marks in emit order: stable-sorted by ChartGuru.ChartMark.ZIndex (ascending), with ties broken by insertion order. When no mark overrides its ZIndex the original list is returned unchanged, avoiding any allocation. Renderers that honor ZIndex(_:) should iterate ChartGuru.Chart.MarksInZOrder instead of ChartGuru.Chart.Marks.

Returns

System.Collections.Generic.IReadOnlyList{ChartGuru.IChartMark}

public MarkComposition Composition { get; }

Snapshot of which mark kinds are present (Bar / Line / Point / Area / Candlestick / Sector / Rule / Rectangle). Drives renderer and layout-engine dispatch so that mixed compositions (e.g. ChartGuru.LineMark + ChartGuru.PointMark, ChartGuru.BarMark + ChartGuru.LineMark) render every kind without per-ChartGuru.Chart.ChartType special cases.

Returns

ChartGuru.MarkComposition

public ProjectionFamily ProjectionFamily { get; }

Coarse projection family this chart renders into: Cartesian (X/Y plot), Polar (pie/donut), Radial (radar), or Indicator. Resolved from ChartGuru.Chart.ChartType first, with a composition-driven fallback when ChartGuru.Chart.ChartType is the default Bar but no bar marks are present.

Returns

ChartGuru.ProjectionFamily

public SeriesCollection Series { get; }

Marks the cached ChartGuru.Chart.Composition as stale. Called from every internal mark-list mutation path.

Returns

ChartGuru.SeriesCollection

public ChartTheme Theme { get; set; }

Returns

ChartGuru.ChartTheme

public AxisConfig XAxis { get; set; }

Returns

ChartGuru.AxisConfig

public AxisConfig YAxis { get; set; }

Returns

ChartGuru.AxisConfig

public AxisConfig ZAxis { get; set; }

Z axis configuration. Only used when ChartGuru.Chart.Dimension is ChartGuru.ChartDimension.ThreeD or the ChartGuru.Chart.ChartType is a 3D variant. Shares ChartGuru.AxisConfig with X/Y. Swift Charts equivalent: .chartZAxis { … }.

Returns

ChartGuru.AxisConfig

public Chart3DPose Pose { get; set; }

Camera pose for 3D charts. No-op for 2D types. Swift Charts equivalent: .Chart3DPose(_:).

Returns

ChartGuru.Chart3DPose

public Chart3DCameraProjection Projection { get; set; }

Camera projection mode for 3D charts. Swift Charts equivalent: .Chart3DCameraProjection(_:).

Returns

ChartGuru.Chart3DCameraProjection

public bool RotateEnabled { get; set; }

Whether drag gestures should rotate the pose on 3D charts.

Returns

System.Boolean

public LegendConfig Legend { get; set; }

Returns

ChartGuru.LegendConfig

public Animation? Animation { get; set; }

Animation used when chart values change. null (the default) applies value changes instantly, matching Swift Charts which requires explicit withAnimation to animate.

Returns

System.Nullable{ChartGuru.Animation}

Remarks

Setting this property only configures the animation used by future data/value changes — it never spawns an animation on its own. This mirrors SwiftUI, where attaching .Animation(_:value:) doesn’t replay anything until the observed value actually changes. Use ChartGuru.Chart.ReplayEntryAnimation(System.Nullable%7bChartGuru.Animation%7d) if you explicitly want to re-run the entry animation.

public bool HasExplicitAuthoringStyle { get; }

Whether an ChartGuru.Chart.AuthoringStyle has been explicitly assigned. Programmatic charts built via Chart.Create(…).Build() never set this, so the inspector should derive style fields from mark properties instead of from the default authoring style.

Returns

System.Boolean

public ChartAuthoringStyleOptions AuthoringStyle { get; set; }

Returns

ChartGuru.ChartAuthoringStyleOptions

public TinyChartConfig TinyConfig { get; }

Returns

ChartGuru.TinyChartConfig

public LayoutMetrics LayoutMetrics { get; }

Current layout metrics computed during CalculateLayout(). Contains scaled font sizes and space allocations for each layout layer.

Returns

ChartGuru.LayoutMetrics

public IReadOnlyDictionary<object, Color> ForegroundStyleScale { get; }

Custom color scale for automatic series color assignment. Swift Charts equivalent: .ChartForegroundStyleScale([…])

Returns

System.Collections.Generic.IReadOnlyDictionary{System.Object,UnityEngine.Color}

public ColorScale ColorScale { get; }

Continuous color scale for mapping numeric ForegroundStyleKey values to colors. Swift Charts equivalent: .ChartForegroundStyleScale(range: Gradient(…))

Returns

ChartGuru.ColorScale

public IReadOnlyDictionary<object, SymbolShape> SymbolScale { get; }

Custom symbol scale for automatic series symbol assignment. Swift Charts equivalent: .ChartSymbolScale([…])

Returns

System.Collections.Generic.IReadOnlyDictionary{System.Object,ChartGuru.SymbolShape}

public PlotStyleConfig PlotStyle { get; set; }

Plot area styling configuration. Swift Charts equivalent: .chartPlotStyle { }

Returns

ChartGuru.PlotStyleConfig

public MarkDimension BarWidth { get; set; }

Chart-level default bar width as a Swift Charts MarkDimension. Per-mark ChartGuru.BarMark.Width(ChartGuru.MarkDimension) overrides this; if both are .automatic the renderer falls back to Swift’s 0.8 step ratio. Swift Charts equivalent: .ChartBarWidth(.ratio(0.8)).

Returns

ChartGuru.MarkDimension

public MarkDimension BarHeight { get; set; }

Chart-level default bar height as a Swift Charts MarkDimension. Used by horizontal bars; per-mark ChartGuru.BarMark.Height(ChartGuru.MarkDimension) wins.

Returns

ChartGuru.MarkDimension

public bool FlattenDivergingBarBaseline { get; set; }

When true, bars in a Standard diverging stack (positive + negative for the same category) use flat edges at the baseline where they meet, rounding only the outer end. When false (default), both ends are rounded matching Swift Charts behavior.

Returns

System.Boolean

public ChartBorderConfig ChartBorder { get; set; }

Border drawn around the entire chart area (outside all content).

Returns

ChartGuru.ChartBorderConfig

public Color? ChartBackground { get; set; }

Chart background color. Swift Charts equivalent: .chartBackground { }

Returns

System.Nullable{UnityEngine.Color}

public Gradient ChartBackgroundGradient { get; }

Chart background gradient.

Returns

UnityEngine.Gradient

public ChartBackgroundMode ChartBackgroundMode { get; set; }

Controls how the chart-level background is rendered: solid colour, linear gradient (with user-selectable direction via ChartGuru.Chart.ChartBackgroundLinearGradient), or a four-corner gradient via ChartGuru.Chart.ChartBackgroundFourCorner. When ChartGuru.ChartBackgroundMode.SolidColor, the ChartGuru.Chart.ChartBackground colour or ChartGuru.Chart.ChartBackgroundGradient (legacy direction-less Unity Gradient) is used.

Returns

ChartGuru.ChartBackgroundMode

public LinearGradientStyle ChartBackgroundLinearGradient { get; set; }

Linear gradient (with direction) used for the chart background when ChartGuru.Chart.ChartBackgroundMode is ChartGuru.ChartBackgroundMode.LinearGradient.

Returns

ChartGuru.LinearGradientStyle

public FourCornerGradient? ChartBackgroundFourCorner { get; set; }

Four-corner gradient used for the chart background when ChartGuru.Chart.ChartBackgroundMode is ChartGuru.ChartBackgroundMode.FourCornerGradient.

Returns

System.Nullable{ChartGuru.FourCornerGradient}

public Color? DataLabelColor { get; set; }

Optional explicit colour for data-label text. When null the active theme’s ChartGuru.ChartTheme.TextColor is used (subject to auto-contrast).

Returns

System.Nullable{UnityEngine.Color}

public Color? AxisLabelColor { get; set; }

Optional explicit colour for axis-label text (X/Y tick labels and radar ring/spoke labels). When null the active theme’s ChartGuru.ChartTheme.TextColor is used. Useful to keep ring-tick values from competing with data labels on radar charts — set a muted/lighter colour to push them visually behind the data.

Returns

System.Nullable{UnityEngine.Color}

public Action<ChartProxy> OverlayCallback { get; }

Callback for overlay interactions. Swift Charts equivalent: .chartOverlay { proxy in }

Returns

System.Action{ChartGuru.ChartProxy}

public Action<ChartProxy> BackgroundCallback { get; }

Callback invoked to draw a custom chart Background (behind all marks) with access to the ChartGuru.ChartProxy. Runs after the solid color / gradient background. Swift Charts equivalent: .chartBackground { proxy in … }

Returns

System.Action{ChartGuru.ChartProxy}

public IReadOnlyDictionary<object, StrokeStyle> LineStyleScale { get; }

Custom line style scale for automatic series line style assignment. Swift Charts equivalent: .ChartLineStyleScale([…])

Returns

System.Collections.Generic.IReadOnlyDictionary{System.Object,ChartGuru.StrokeStyle}

public IReadOnlyDictionary<object, float> SymbolSizeScale { get; }

Custom symbol size scale for automatic series symbol size assignment. Swift Charts equivalent: .ChartSymbolSizeScale([…])

Returns

System.Collections.Generic.IReadOnlyDictionary{System.Object,System.Single}

public Func<ChartProxy, ChartGesture> GestureFactory { get; }

Gesture factory for custom interaction handling. Swift Charts equivalent: .chartGesture { proxy in }

Returns

System.Func{ChartGuru.ChartProxy,ChartGuru.ChartGesture}

public ScaleType? XScaleType { get; }

Scale type for X axis. Swift Charts equivalent: .ChartXScale(domain:type:)

Returns

System.Nullable{ChartGuru.ScaleType}

public ScaleType? YScaleType { get; }

Scale type for Y axis. Swift Charts equivalent: .ChartYScale(domain:type:)

Returns

System.Nullable{ChartGuru.ScaleType}

public ClosedRange<float>? XScaleRange { get; }

Output range for X scale. Swift Charts equivalent: .ChartXScale(range:)

Returns

System.Nullable{ChartGuru.ClosedRange{System.Single}}

public ClosedRange<float>? YScaleRange { get; }

Output range for Y scale. Swift Charts equivalent: .ChartYScale(range:)

Returns

System.Nullable{ChartGuru.ClosedRange{System.Single}}

public ClosedRange<float>? ExplicitXDomain { get; }

Explicit data domain override for X scale. Swift Charts equivalent: .ChartXScale(domain:)

Returns

System.Nullable{ChartGuru.ClosedRange{System.Single}}

public ClosedRange<float>? ExplicitYDomain { get; }

Explicit data domain override for Y scale. Swift Charts equivalent: .ChartYScale(domain:)

Returns

System.Nullable{ChartGuru.ClosedRange{System.Single}}

public ClosedRange<float>? ExplicitZDomain { get; }

Explicit data domain override for Z scale on 3D charts. Swift Charts equivalent: .chartZScale(domain:)

Returns

System.Nullable{ChartGuru.ClosedRange{System.Single}}

public ChartType ChartType { get; set; }

Returns

ChartGuru.ChartType

public ChartDimension Dimension { get; }

Returns

ChartGuru.ChartDimension

public DirtyFlags DirtyFlags { get; }

Returns

ChartGuru.DirtyFlags

public Rect PlotArea { get; }

Returns

UnityEngine.Rect

public bool IsTiny { get; }

Returns true if this is a compact/tiny chart type (Sparkline, MiniBar, MiniPie, MiniDonut, Indicator). Horizontal orientation does not affect tininess — a MiniBar with horizontal orientation is still tiny.

Returns

System.Boolean

public BarLayout PreferredBarLayout { get; set; }

Default bar orientation when the chart has no ChartGuru.BarMarks yet. Authoring surfaces (designer/inspector) write this from a serialized “Bar Orientation” field; the data source then materializes BarMarks with matching ChartGuru.BarMark.Layout. Once any BarMark is present, ChartGuru.Chart.IsHorizontalBar derives directly from mark layouts.

Returns

ChartGuru.BarLayout

public bool IsHorizontalBar { get; }

True when this chart renders bars horizontally (value axis = X, category axis = Y). Mirrors Swift Charts’ rule that horizontal bars emerge from a categorical-Y / numeric-X data binding: the answer is derived from the mark layouts whenever any ChartGuru.BarMark exists, falling back to ChartGuru.Chart.PreferredBarLayout for empty-marks scenarios. This keeps the orientation source-of-truth on the data, not on a chart-type variant.

Returns

System.Boolean

public bool IsBuilt { get; }

Returns

System.Boolean

public Vector2 Size { get; set; }

Returns

UnityEngine.Vector2

public bool ShowAxisTitles { get; set; }

Controls whether axis titles are shown and affect layout. When false, axis title space is reclaimed for the chart.

Returns

System.Boolean

public bool ShowAxisLabels { get; set; }

Controls whether axis labels are shown and affect layout. When false, axis label space is reclaimed for the chart.

Returns

System.Boolean

public bool ShowDataLabels { get; set; }

Controls whether data labels are shown and affect layout. When true, extra margin is reserved for labels above/beside data points.

Returns

System.Boolean

public string DataLabelFormat { get; set; }

Format string for data labels (e.g. “{Value(F0)}k”, “{percent}”). When set on the Chart, ChartGraphic picks it up during sync.

Returns

System.String

public PieLabelMode PieLabelMode { get; set; }

Returns

ChartGuru.PieLabelMode

public SelectionIndicatorStyle SelectionIndicatorStyle { get; set; }

Style for selection/hover indicators.

Returns

ChartGuru.SelectionIndicatorStyle

public string ChartTitle { get; set; }

Optional chart title text. When non-empty, the title block is rendered.

Returns

System.String

public string AccessibilityLabel { get; set; }

Chart-level accessibility label / summary. Swift Charts equivalent: ChartAccessibilityLabel(:) / ChartAccessibilityRepresentation(:). When unset, ChartGuru.Chart.GetAccessibilitySummary falls back to a generated description derived from ChartGuru.Chart.ChartTitle, mark count, and series count.

Returns

System.String

public string AccessibilityDescription { get; set; }

Optional secondary accessibility description (Swift’s chartAccessibilityRepresentation).

Returns

System.String

public string ChartSubtitle { get; set; }

Returns an accessibility summary for the chart. If ChartGuru.Chart.AccessibilityLabel is set it wins; otherwise a fallback is generated from the chart title/marks.

Returns

System.String

public ChartTitlePosition ChartTitlePosition { get; set; }

Position and alignment of the chart title/subtitle block. Encodes both vertical (top/bottom) and horizontal (leading/center/trailing) placement.

Returns

ChartGuru.ChartTitlePosition

public bool HasChartTitle { get; }

Returns true when either the chart title or subtitle has text content.

Returns

System.Boolean

public bool ChartTitleIsTop { get; }

Returns true when the title block is positioned at the top of the chart.

Returns

System.Boolean

public bool IsMorphing { get; }

Requests a chart-type transition. Uses ChartGuru.Chart.Animation.Default as the animation curve. For a custom animation, use the overload taking ChartGuru.MorphOptions.

Returns

System.Boolean

public int ColorScalePresetIndex { get; set; }

Preferred color scale preset index (-1 = none/default Blue). Used by the layout engine when auto-creating a color scale from data. Indices: 0=Blue, 1=Viridis, 2=Heat, 3=Cool, 4=Warm, 5=Diverging, 6=Grayscale.

Returns

System.Int32

public ScrollableAxes ScrollableAxes { get; set; }

Scrollable axis configuration for viewport-based charts.

Returns

ChartGuru.ScrollableAxes

public ClosedRange<float>? XVisibleDomain { get; set; }

Explicit X viewport domain.

Returns

System.Nullable{ChartGuru.ClosedRange{System.Single}}

public ClosedRange<float>? YVisibleDomain { get; set; }

Explicit Y viewport domain.

Returns

System.Nullable{ChartGuru.ClosedRange{System.Single}}

public float? XVisibleDomainLength { get; set; }

X viewport length in data units.

Returns

System.Nullable{System.Single}

public float? YVisibleDomainLength { get; set; }

Y viewport length in data units.

Returns

System.Nullable{System.Single}

public float? ScrollPositionX { get; set; }

Scroll origin for the X viewport.

Returns

System.Nullable{System.Single}

public float? ScrollPositionY { get; set; }

Scroll origin for the Y viewport.

Returns

System.Nullable{System.Single}

public ClosedRange<float> DataXDomain { get; }

Raw X data domain before viewport clipping.

Returns

ChartGuru.ClosedRange{System.Single}

public ClosedRange<float> DataYDomain { get; }

Raw Y data domain before viewport clipping.

Returns

ChartGuru.ClosedRange{System.Single}

public ClosedRange<float> EffectiveXDomain { get; }

Effective X domain used for rendering.

Returns

ChartGuru.ClosedRange{System.Single}

public ClosedRange<float> EffectiveYDomain { get; }

Effective Y domain used for rendering. Reported in axis-coordinate space: for a logarithmic Y axis the bounds are log_b(rawMin) / log_b(rawMax), not the raw data extents.

Returns

ChartGuru.ClosedRange{System.Single}

public int SelectedIndex { get; set; }

Returns

System.Int32

public float? SelectedXValue { get; set; }

Selected X-axis value for Swift Charts-style selection flows.

Returns

System.Nullable{System.Single}

public float? SelectedYValue { get; set; }

Selected Y-axis value for Swift Charts-style selection flows.

Returns

System.Nullable{System.Single}

public float? SelectedAngleValue { get; set; }

Selected angle value for pie/donut selection flows.

Returns

System.Nullable{System.Single}

public ClosedRange<float>? SelectedXRange { get; set; }

Selected X-range for brush/range selection interactions.

Returns

System.Nullable{ChartGuru.ClosedRange{System.Single}}

public ClosedRange<float>? SelectedYRange { get; set; }

Selected Y-range for brush/range selection interactions.

Returns

System.Nullable{ChartGuru.ClosedRange{System.Single}}

public float? SelectedZValue { get; set; }

Selected Z-axis value for Swift-Charts-3D chartZSelection flows.

Returns

System.Nullable{System.Single}

public ClosedRange<float>? SelectedZRange { get; set; }

Selected Z-range for brush/range selection interactions on 3D charts.

Returns

System.Nullable{ChartGuru.ClosedRange{System.Single}}

public ScaleType? ZScaleType { get; }

Scale type for the Z axis (3D charts only).

Returns

System.Nullable{ChartGuru.ScaleType}

public ClosedRange<float>? ZScaleRange { get; }

Output range for the Z scale (3D charts only).

Returns

System.Nullable{ChartGuru.ClosedRange{System.Single}}

public ClosedRange<float> DataZDomain { get; }

Data-derived Z domain.

Returns

ChartGuru.ClosedRange{System.Single}

public ClosedRange<float> EffectiveZDomain { get; }

Effective Z domain used for rendering.

Returns

ChartGuru.ClosedRange{System.Single}

public float SelectionDimOpacity { get; set; }

Opacity for non-selected marks when a selection is active (0-1). Default is 0.3f matching Swift Charts behavior.

Returns

System.Single

public bool HasSelection { get; }

Returns true if any data point is currently selected.

Returns

System.Boolean

public int HoveredIndex { get; set; }

The currently hovered data point index, or -1 if nothing is hovered. Used for hover highlight effects.

Returns

System.Int32

public bool HasHover { get; }

Returns true if any data point is currently hovered.

Returns

System.Boolean

public event Action<Chart> OnChartChanged

Raised after chart data, configuration, layout, or presentation state changes.

Returns

System.Action{ChartGuru.Chart}

public event Action<Chart, ChartType> OnMorphComplete

Raised with the target chart type after an animated morph completes.

Returns

System.Action{ChartGuru.Chart,ChartGuru.ChartType}

public event Action<Chart> OnPoseChanged

Raised when ChartGuru.Chart.Pose or ChartGuru.Chart.Projection changes (3D charts).

Returns

System.Action{ChartGuru.Chart}

public event Action<Chart, int> OnSelectionChanged

Raised with the selected mark index after selection changes.

Returns

System.Action{ChartGuru.Chart,System.Int32}

public event Action<Chart, int> OnHoverChanged

Raised with the hovered mark index, or -1 when no mark is hovered.

Returns

System.Action{ChartGuru.Chart,System.Int32}

public event Action<float?> OnXSelectionChanged

Raised when the selected horizontal value changes or is cleared.

Returns

System.Action{System.Nullable{System.Single}}

public event Action<float?> OnYSelectionChanged

Raised when the selected vertical value changes or is cleared.

Returns

System.Action{System.Nullable{System.Single}}

public event Action<float?> OnAngleSelectionChanged

Raised when the selected sector value changes or is cleared.

Returns

System.Action{System.Nullable{System.Single}}

public event Action<ClosedRange<float>?> OnXRangeSelectionChanged

Raised when the selected horizontal range changes or is cleared.

Returns

System.Action{System.Nullable{ChartGuru.ClosedRange{System.Single}}}

public event Action<ClosedRange<float>?> OnYRangeSelectionChanged

Raised when the selected vertical range changes or is cleared.

Returns

System.Action{System.Nullable{ChartGuru.ClosedRange{System.Single}}}

public event Action<float?> OnZSelectionChanged

Raised when ChartGuru.Chart.SelectedZValue changes (3D charts).

Returns

System.Action{System.Nullable{System.Single}}

public event Action<ClosedRange<float>?> OnZRangeSelectionChanged

Raised when ChartGuru.Chart.SelectedZRange changes (3D charts).

Returns

System.Action{System.Nullable{ChartGuru.ClosedRange{System.Single}}}