Skip to content

AxisConfig

ClassChartGuruChartGuru
[Serializable]
public class AxisConfig

Configuration data for a chart axis. Contains all settings for axis visibility, domain, styling, ticks, and labels.

[Tooltip("Show or hide this entire axis.")]
public bool Visible

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Draw the axis line along the plot edge.")]
public bool ShowAxisLine

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Draw grid lines across the plot area at each tick.")]
public bool ShowGridLines

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Internal: tracks whether ShowGridLines was explicitly set by the user/parser.")]
public bool GridLinesExplicitlySet

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Draw tick marks along the axis line.")]
public bool ShowTicks

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Draw value labels at each tick position.")]
public bool ShowLabels

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Derive the axis domain automatically from the data range.")]
public bool AutoDomain

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Always include zero when auto-calculating the domain.")]
public bool IncludeZeroInDomain

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Internal: tracks whether IncludeZeroInDomain was explicitly set by the API.")]
public bool IncludeZeroExplicitlySet

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Minimum axis Value (used when Auto Domain is disabled).")]
public float DomainMin

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("Maximum axis Value (used when Auto Domain is disabled).")]
public float DomainMax

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("Flip the axis so values increase in the opposite direction.")]
public bool Inverted

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Internal: tracks whether the domain was set programmatically.")]
public bool DomainExplicitlySet

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Extra inner Padding (in pixels) at the start of this axis (data-side). Signed: negative values extend marks past the plot edge.")]
public float RangeStartPadding

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("Extra inner Padding (in pixels) at the end of this axis (data-side). Signed: negative values extend marks past the plot edge.")]
public float RangeEndPadding

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("Space reserved for this axis in pixels.")]
[Range(10, 200)]
public float Size

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("Base value for the logarithmic scale (e.g. 10 for log10, 2 for log2).")]
[Range(2, 100)]
public float LogBase

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("Width of the linear band around zero for SymmetricLog scales (Swift Charts: slopeAtZero). Defaults to 1.")]
public float LogScaleSlopeAtZero

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("Exponent used for Power scales (Swift Charts: exponent). Defaults to 0.5 (square-root).")]
public float PowerExponent

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("Snap tick values to round numbers (1, 2, 5 multiples). Disable for evenly-spaced ticks across the exact domain.")]
public bool UseNiceTicks

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Number of tick marks and grid lines to display along the axis.")]
[Range(2, 20)]
public int TickCount

No description is available for this member.

Returns

System.Int32 — No return description is available.

[Tooltip("Length of tick marks in pixels.")]
[Range(0, 20)]
public float TickLength

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("How tick length is resolved at render time. Fixed/Automatic use TickLength directly; Label uses each tick's label width/height; LongestLabel uses the longest emitted label.")]
public AxisTickLengthMode TickLengthMode

No description is available for this member.

Returns

ChartGuru.AxisTickLengthMode — No return description is available.

[Tooltip("Extra pixels added past the resolved tick length when TickLengthMode is Label or LongestLabel (Swift Charts: extendPastBy).")]
public float TickLengthExtendBy

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("Force a specific tick-label rotation. Automatic preserves the existing fit-based rotation logic. Swift Charts: AxisValueLabelOrientation.")]
public AxisValueLabelOrientation LabelOrientation

No description is available for this member.

Returns

ChartGuru.AxisValueLabelOrientation — No return description is available.

[Tooltip("Strategy for resolving overlapping tick labels. Swift Charts: AxisValueLabelCollisionResolution.")]
public AxisValueLabelCollisionResolution LabelCollisionResolution

No description is available for this member.

Returns

ChartGuru.AxisValueLabelCollisionResolution — No return description is available.

[Tooltip("Draw the axis line through the data origin (zero) instead of the plot edge when the axis crosses zero. Swift Charts: chartXAxisAlignsOrigin / chartYAxisAlignsOrigin.")]
public bool AlignsOrigin

No description is available for this member.

Returns

System.Boolean — No return description is available.

[NonSerialized]
public Func<ClosedRange<float>, ClosedRange<float>> ModifyInferredDomain

Optional callback invoked after auto-domain inference, before range padding. Receives the inferred ChartGuru.ClosedRange%601 and returns the (possibly modified) final range. Swift Charts equivalent: ChartXScale(domain: .Automatic(includesZero:reversed:)) .modifyInferredDomain { range in … }.

Returns

System.Func{ChartGuru.ClosedRange{System.Single},ChartGuru.ClosedRange{System.Single}} — No return description is available.

[NonSerialized]
public IScaleTransformer CustomScaleTransformer

Pluggable axis scale transformer. When non-null, overrides the built-in ChartGuru.AxisScaleType branches in ChartGuru.AxisConfig.TransformValue(System.Single) and ChartGuru.AxisConfig.InverseTransformValue(System.Single). Swift Charts equivalent: ChartXScale(transformer:) / ChartYScale(transformer:).

Returns

ChartGuru.IScaleTransformer — No return description is available.

[Tooltip("Number format for tick labels (F0 = integer, F1 = one decimal, P0 = percent, etc.).")]
public string TickFormat

No description is available for this member.

Returns

System.String — No return description is available.

[NonSerialized]
public Func<float, string> TickFormatter

No description is available for this member.

Returns

System.Func{System.Single,System.String} — No return description is available.

[Tooltip("High-level formatting style applied to tick labels. 'Custom' falls back to TickFormat/TickFormatter.")]
public AxisFormatStyle FormatStyle

No description is available for this member.

Returns

ChartGuru.AxisFormatStyle — No return description is available.

[Tooltip("When true, tick labels display the absolute Value (e.g. for diverging/pyramid charts).")]
public bool UseAbsoluteValueLabels

No description is available for this member.

Returns

System.Boolean — No return description is available.

[NonSerialized]
public CultureInfo Culture

No description is available for this member.

Returns

System.Globalization.CultureInfo — No return description is available.

[NonSerialized]
public int InferredTickPrecision

Transient precision inferred by the layout engine from the actual tick values. When > 0 and no explicit ChartGuru.AxisConfig.TickFormat is set, FormatAxisTick uses this to ensure consistent decimal places across all ticks on the axis (e.g. step=0.5 → precision=1 → “-1.0, -0.5, 0.0, 0.5, 1.0”).

Returns

System.Int32 — No return description is available.

[Tooltip("Override automatic tick placement with these exact axis values.")]
public float[] CustomTickValues

Custom tick Values (overrides TickCount when set). Swift Charts equivalent: AxisMarks(values: […])

Returns

System.Single[] — No return description is available.

public AxisMarkConfig MarkConfig

Configuration for individual axis marks. Swift Charts equivalent: AxisMarks { AxisTick(), AxisGridLine(), AxisValueLabel() }

Returns

ChartGuru.AxisMarkConfig — No return description is available.

public List<AxisMarkConfig> MarksBlocks

Multiple independent AxisMarks blocks on this axis. Each block can have its own position, tick values, visibility, and styling. When populated, the renderer uses these blocks instead of the flat fields above. Swift Charts equivalent: multiple AxisMarks(…) { } closures inside .chartXAxis { }.

Returns

System.Collections.Generic.List{ChartGuru.AxisMarkConfig} — No return description is available.

public AxisMarkPreset LabelPreset

Simple label preset override for the default (non-MarksBlocks) labels. Automatic = chart-type default. Inset = inside plot area. Aligned/Extended = outside. When MarksBlocks are present, their per-block Preset takes precedence.

Returns

ChartGuru.AxisMarkPreset — No return description is available.

[Tooltip("Title text displayed alongside the axis.")]
public string Label

No description is available for this member.

Returns

System.String — No return description is available.

[Tooltip("Cross-axis alignment for the axis title within its reserved zone.")]
public AxisLabelAlignment LabelAlignment

No description is available for this member.

Returns

ChartGuru.AxisLabelAlignment — No return description is available.

[Tooltip("Along-axis position for the axis title (leading/center/trailing).")]
public AxisLabelPosition LabelPosition

No description is available for this member.

Returns

ChartGuru.AxisLabelPosition — No return description is available.

[Tooltip("Extra pixels between the plot area and the axis title along the axis's dominant direction.")]
public float LabelSpacing

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("Font style applied to the axis tick labels.")]
public FontStyle LabelFontStyle

No description is available for this member.

Returns

UnityEngine.FontStyle — No return description is available.

[Tooltip("Where to place this axis relative to the plot area.")]
public AxisPosition Position

No description is available for this member.

Returns

ChartGuru.AxisPosition — No return description is available.

[Tooltip("Extra space in pixels between the axis and adjacent elements.")]
[Range(0, 40)]
public float Padding

No description is available for this member.

Returns

System.Single — No return description is available.

[Tooltip("Start of the time domain when Auto Domain is disabled.")]
public DateTime TimeDomainMin

No description is available for this member.

Returns

System.DateTime — No return description is available.

[Tooltip("End of the time domain when Auto Domain is disabled.")]
public DateTime TimeDomainMax

No description is available for this member.

Returns

System.DateTime — No return description is available.

[NonSerialized]
public bool TimeDomainExplicitlySet

No description is available for this member.

Returns

System.Boolean — No return description is available.

[NonSerialized]
public double TimeOriginEpochSeconds

Epoch Offset (seconds since Unix epoch) subtracted from mark X values before they were stored as float. Added back when converting to System.DateTime for label formatting. Solves float-precision loss for modern timestamps.

Returns

System.Double — No return description is available.

[Tooltip("Time interval unit for tick spacing (Auto chooses based on the visible range).")]
public TimeUnit TimeUnit

No description is available for this member.

Returns

ChartGuru.TimeUnit — No return description is available.

[Tooltip("Date/time format string for tick labels (e.g. 'dd MMM', 'HH:mm', 'yyyy').")]
public string TimeFormat

No description is available for this member.

Returns

System.String — No return description is available.

[NonSerialized]
public bool HasStride

No description is available for this member.

Returns

System.Boolean — No return description is available.

[NonSerialized]
public float Stride

No description is available for this member.

Returns

System.Single — No return description is available.

[NonSerialized]
public TimeUnit? StrideUnit

No description is available for this member.

Returns

System.Nullable{ChartGuru.TimeUnit} — No return description is available.

[NonSerialized]
public int StrideMultiplier

Multiplier for calendar strides. Swift Charts equivalent: the count: argument of AxisMarkValues.Stride(by:count:). A value of 1 means “every unit”, 2 means “every other unit”, etc. Ignored unless ChartGuru.AxisConfig.StrideUnit is set.

Returns

System.Int32 — No return description is available.

[NonSerialized]
public Action<AxisValue, AxisMarksBuilder> ValueCallback

No description is available for this member.

Returns

System.Action{ChartGuru.AxisValue,ChartGuru.AxisMarksBuilder} — No return description is available.

[NonSerialized]
public Dictionary<float, string> PerTickLabelOverrides

No description is available for this member.

Returns

System.Collections.Generic.Dictionary{System.Single,System.String} — No return description is available.

[NonSerialized]
public HashSet<float> HiddenTickValues

No description is available for this member.

Returns

System.Collections.Generic.HashSet{System.Single} — No return description is available.

[NonSerialized]
public HashSet<float> HiddenTickMarkValues

Per-value tick mark hiding. Values in this set skip the tick mark but retain grid lines and label positions. Used for minor grid lines where only the grid line should render without a tick mark.

Returns

System.Collections.Generic.HashSet{System.Single} — No return description is available.

[NonSerialized]
public HashSet<float> HiddenLabelValues

Per-value label hiding. Values in this set retain grid lines and tick marks but their label text is blanked. Populated by ChartGuru.AxisMarksBuilder.HideLabel inside a ChartGuru.AxisMarksBuilder.ForEachValue(System.Action%7bChartGuru.AxisValue%2cChartGuru.AxisMarksBuilder%7d) callback. Swift Charts equivalent: conditionally not emitting AxisValueLabel() in the per-value closure.

Returns

System.Collections.Generic.HashSet{System.Single} — No return description is available.

[NonSerialized]
public HashSet<float> HiddenGridLineValues

Per-value grid line hiding. Values in this set skip grid line rendering but retain tick marks and labels. Populated by ChartGuru.AxisMarksBuilder.HideGridLine inside a ChartGuru.AxisMarksBuilder.ForEachValue(System.Action%7bChartGuru.AxisValue%2cChartGuru.AxisMarksBuilder%7d) callback. Swift Charts equivalent: conditionally not emitting AxisGridLine() in the per-value closure.

Returns

System.Collections.Generic.HashSet{System.Single} — No return description is available.

[NonSerialized]
public HashSet<float> MinorGridLineValues

Values that receive minor (lighter/thinner) grid line styling instead of the default major grid style. Swift Charts equivalent: conditional AxisGridLine with different stroke/foregroundStyle inside an if/else AxisMarks closure.

Returns

System.Collections.Generic.HashSet{System.Single} — No return description is available.

[NonSerialized]
public Color? MinorGridLineColor

No description is available for this member.

Returns

System.Nullable{UnityEngine.Color} — No return description is available.

[NonSerialized]
public float? MinorGridLineWidth

No description is available for this member.

Returns

System.Nullable{System.Single} — No return description is available.

[NonSerialized]
public StrokeStyle? GridLineStroke

Optional stroke style for grid lines, including dash pattern. Swift Charts equivalent: AxisGridLine(stroke: StrokeStyle(…)) When set, overrides ChartGuru.AxisConfig.GridLineWidth and enables dashed rendering.

Returns

System.Nullable{ChartGuru.StrokeStyle} — No return description is available.

[NonSerialized]
public StrokeStyle? TickStroke

Optional stroke style for tick marks, including dash pattern. Swift Charts equivalent: AxisTick(stroke: StrokeStyle(…)) When set, overrides tick rendering width and enables dashed ticks.

Returns

System.Nullable{ChartGuru.StrokeStyle} — No return description is available.

[NonSerialized]
public bool HasMajorMinorGrid

No description is available for this member.

Returns

System.Boolean — No return description is available.

[NonSerialized]
public bool IntegerOnlyMajorGrid

No description is available for this member.

Returns

System.Boolean — No return description is available.

[NonSerialized]
public bool HasLabelStride

No description is available for this member.

Returns

System.Boolean — No return description is available.

[NonSerialized]
public float LabelStride

No description is available for this member.

Returns

System.Single — No return description is available.

[NonSerialized]
public TimeUnit? LabelStrideUnit

No description is available for this member.

Returns

System.Nullable{ChartGuru.TimeUnit} — No return description is available.

[NonSerialized]
public int LabelStrideMultiplier

No description is available for this member.

Returns

System.Int32 — No return description is available.

[Tooltip("Ordered list of category labels for a band axis.")]
public string[] Categories

No description is available for this member.

Returns

System.String[] — No return description is available.

public const float LogScaleEpsilon = 1E-06

Smallest positive value used as the floor for logarithmic transforms. Anything at or below this is clamped before UnityEngine.Mathf.Log(System.Single%2cSystem.Single) to avoid producing -Infinity/NaN. Public so callers (including tests) can be explicit about the floor when authoring data with zeroes/negatives on a log axis.

Returns

System.Single — No return description is available.

public float MinValue { get; set; }

No description is available for this member.

Returns

System.Single — No return description is available.

public float MaxValue { get; set; }

No description is available for this member.

Returns

System.Single — No return description is available.

public bool HasCustomDomain { get; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public bool HasExplicitDomain { get; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public bool UsesDefaultDomainFallback { get; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public bool HasRangePadding { get; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Use a logarithmic instead of a linear scale. Equivalent to ScaleType == Logarithmic.")]
public bool UseLogScale { get; set; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public bool HasMarksBlocks { get; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public string LabelFormat { get; set; }

No description is available for this member.

Returns

System.String — No return description is available.

public Color AxisColor { get; set; }

No description is available for this member.

Returns

UnityEngine.Color — No return description is available.

public bool InheritAxisColor { get; set; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public Color GridLineColor { get; set; }

No description is available for this member.

Returns

UnityEngine.Color — No return description is available.

public bool InheritGridLineColor { get; set; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public Color LabelColor { get; set; }

No description is available for this member.

Returns

UnityEngine.Color — No return description is available.

public bool InheritLabelColor { get; set; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public float AxisLineWidth { get; set; }

No description is available for this member.

Returns

System.Single — No return description is available.

public bool InheritAxisLineWidth { get; set; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public float GridLineWidth { get; set; }

No description is available for this member.

Returns

System.Single — No return description is available.

public bool InheritGridLineWidth { get; set; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public int LabelFontSize { get; set; }

No description is available for this member.

Returns

System.Int32 — No return description is available.

public bool InheritLabelFontSize { get; set; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public int TitleFontSize { get; set; }

No description is available for this member.

Returns

System.Int32 — No return description is available.

public bool InheritTitleFontSize { get; set; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public AxisScaleType ScaleType { get; set; }

Scale type enumeration for scale configuration. Swift Charts equivalent: ScaleType parameter in chartXScale/chartYScale

Returns

ChartGuru.AxisScaleType — No return description is available.

[Tooltip("Interpret X values as time data and display date/time labels. Equivalent to ScaleType == Time.")]
public bool IsTimeAxis { get; set; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

[Tooltip("Treat this as a categorical (band) axis with discrete named values. Equivalent to ScaleType == Categorical.")]
public bool IsBandAxis { get; set; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public Color TickColor { get; set; }

No description is available for this member.

Returns

UnityEngine.Color — No return description is available.

public bool InheritTickColor { get; set; }

No description is available for this member.

Returns

System.Boolean — No return description is available.

public float TransformValue(float value)

Maps a raw data value into the axis’s working coordinate space. For log-scaled axes this returns log(max(value, epsilon)) / log(LogBase) so callers can keep using linear (v - min) / (max - min) normalization unchanged. For non-log axes this is the identity. Thread-safe / allocation-free.

Parameters

Name Type Description
value System.Single

Returns

System.Single — No return description is available.

public float InverseTransformValue(float transformed)

Inverse of ChartGuru.AxisConfig.TransformValue(System.Single): maps a value in the axis’s working coordinate space back to the raw data space. Used when generating tick labels for logarithmic axes (the tick value emitted to the user is the raw exponentiated number, not the log of it).

Parameters

Name Type Description
transformed System.Single

Returns

System.Single — No return description is available.

public string FormatTick(float value)

Format a tick value as a string.

Parameters

Name Type Description
value System.Single

Returns

System.String — No return description is available.

public Color ResolveAxisColor(ChartTheme theme)

No description is available for this member.

Parameters

Name Type Description
theme ChartGuru.ChartTheme

Returns

UnityEngine.Color — No return description is available.

public Color ResolveTickColor(ChartTheme theme)

Tick colour, resolved with theme + AxisColor fallback. When the user has not explicitly set a tick colour, ticks share the axis line colour (the legacy behaviour). Once ChartGuru.AxisConfig.TickColor is assigned, ticks render with that colour while the axis line stays at ChartGuru.AxisConfig.AxisColor.

Parameters

Name Type Description
theme ChartGuru.ChartTheme

Returns

UnityEngine.Color — No return description is available.

public Color ResolveGridLineColor(ChartTheme theme)

No description is available for this member.

Parameters

Name Type Description
theme ChartGuru.ChartTheme

Returns

UnityEngine.Color — No return description is available.

public Color ResolveLabelColor(ChartTheme theme)

No description is available for this member.

Parameters

Name Type Description
theme ChartGuru.ChartTheme

Returns

UnityEngine.Color — No return description is available.

public float ResolveAxisLineWidth(ChartTheme theme)

No description is available for this member.

Parameters

Name Type Description
theme ChartGuru.ChartTheme

Returns

System.Single — No return description is available.

public float ResolveGridLineWidth(ChartTheme theme)

No description is available for this member.

Parameters

Name Type Description
theme ChartGuru.ChartTheme

Returns

System.Single — No return description is available.

public int ResolveLabelFontSize(ChartTheme theme)

No description is available for this member.

Parameters

Name Type Description
theme ChartGuru.ChartTheme

Returns

System.Int32 — No return description is available.

public int ResolveTitleFontSize(ChartTheme theme)

No description is available for this member.

Parameters

Name Type Description
theme ChartGuru.ChartTheme

Returns

System.Int32 — No return description is available.

public void ResetStyleToBuiltInDefaults(bool inheritFromTheme = true)

No description is available for this member.

Parameters

Name Type Description
inheritFromTheme System.Boolean
public AxisConfig Clone()

Create a copy of this config.

Returns

ChartGuru.AxisConfig — No return description is available.