Skip to content

AxisConfig

ClassChartGuruChartGuru
public class AxisConfig

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

public bool Visible

Returns

System.Boolean

public bool ShowAxisLine

Returns

System.Boolean

public bool ShowGridLines

Returns

System.Boolean

public bool GridLinesExplicitlySet

Returns

System.Boolean

public bool ShowTicks

Returns

System.Boolean

public bool ShowLabels

Returns

System.Boolean

public bool AutoDomain

Returns

System.Boolean

public bool IncludeZeroInDomain

Returns

System.Boolean

public bool IncludeZeroExplicitlySet

Returns

System.Boolean

public float DomainMin

Returns

System.Single

public float DomainMax

Returns

System.Single

public bool Inverted

Returns

System.Boolean

public bool DomainExplicitlySet

Returns

System.Boolean

public float RangeStartPadding

Returns

System.Single

public float RangeEndPadding

Returns

System.Single

public float Size

Returns

System.Single

public float LogBase

Returns

System.Single

public float LogScaleSlopeAtZero

Returns

System.Single

public float PowerExponent

Returns

System.Single

public bool UseNiceTicks

Returns

System.Boolean

public int TickCount

Returns

System.Int32

public float TickLength

Returns

System.Single

public AxisTickLengthMode TickLengthMode

Returns

ChartGuru.AxisTickLengthMode

public float TickLengthExtendBy

Returns

System.Single

public AxisValueLabelOrientation LabelOrientation

Returns

ChartGuru.AxisValueLabelOrientation

public AxisValueLabelCollisionResolution LabelCollisionResolution

Returns

ChartGuru.AxisValueLabelCollisionResolution

public bool AlignsOrigin

Returns

System.Boolean

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}}

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

public string TickFormat

Returns

System.String

public Func<float, string> TickFormatter

Returns

System.Func{System.Single,System.String}

public AxisFormatStyle FormatStyle

Returns

ChartGuru.AxisFormatStyle

public bool UseAbsoluteValueLabels

Returns

System.Boolean

public CultureInfo Culture

Returns

System.Globalization.CultureInfo

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

public float[] CustomTickValues

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

Returns

System.Single[]

public AxisMarkConfig MarkConfig

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

Returns

ChartGuru.AxisMarkConfig

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}

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

public string Label

Returns

System.String

public AxisLabelAlignment LabelAlignment

Returns

ChartGuru.AxisLabelAlignment

public AxisLabelPosition LabelPosition

Returns

ChartGuru.AxisLabelPosition

public float LabelSpacing

Returns

System.Single

public FontStyle LabelFontStyle

Returns

UnityEngine.FontStyle

public AxisPosition Position

Returns

ChartGuru.AxisPosition

public float Padding

Returns

System.Single

public DateTime TimeDomainMin

Returns

System.DateTime

public DateTime TimeDomainMax

Returns

System.DateTime

public bool TimeDomainExplicitlySet

Returns

System.Boolean

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

public TimeUnit TimeUnit

Returns

ChartGuru.TimeUnit

public string TimeFormat

Returns

System.String

public bool HasStride

Returns

System.Boolean

public float Stride

Returns

System.Single

public TimeUnit? StrideUnit

Returns

System.Nullable{ChartGuru.TimeUnit}

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

public Action<AxisValue, AxisMarksBuilder> ValueCallback

Returns

System.Action{ChartGuru.AxisValue,ChartGuru.AxisMarksBuilder}

public Dictionary<float, string> PerTickLabelOverrides

Returns

System.Collections.Generic.Dictionary{System.Single,System.String}

public HashSet<float> HiddenTickValues

Returns

System.Collections.Generic.HashSet{System.Single}

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}

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}

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}

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}

public Color? MinorGridLineColor

Returns

System.Nullable{UnityEngine.Color}

public float? MinorGridLineWidth

Returns

System.Nullable{System.Single}

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}

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}

public bool HasMajorMinorGrid

Returns

System.Boolean

public bool IntegerOnlyMajorGrid

Returns

System.Boolean

public bool HasLabelStride

Returns

System.Boolean

public float LabelStride

Returns

System.Single

public TimeUnit? LabelStrideUnit

Returns

System.Nullable{ChartGuru.TimeUnit}

public int LabelStrideMultiplier

Returns

System.Int32

public string[] Categories

Returns

System.String[]

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

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
value System.Single

Returns

System.Single

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
transformed System.Single

Returns

System.Single

public string FormatTick(float value)

Format a tick value as a string.

Parameters

Name Type
value System.Single

Returns

System.String

public Color ResolveAxisColor(ChartTheme theme)

Returns the explicit axis color, or the active theme’s axis color when no override is set.

Parameters

Name Type
theme ChartGuru.ChartTheme

Returns

UnityEngine.Color

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
theme ChartGuru.ChartTheme

Returns

UnityEngine.Color

public Color ResolveGridLineColor(ChartTheme theme)

Returns the explicit grid-line color, or the active theme’s grid color when no override is set.

Parameters

Name Type
theme ChartGuru.ChartTheme

Returns

UnityEngine.Color

public Color ResolveLabelColor(ChartTheme theme)

Returns the explicit label color, or the active theme’s label color when no override is set.

Parameters

Name Type
theme ChartGuru.ChartTheme

Returns

UnityEngine.Color

public float ResolveAxisLineWidth(ChartTheme theme)

Returns the explicit axis-line width, or the active theme’s width when no override is set.

Parameters

Name Type
theme ChartGuru.ChartTheme

Returns

System.Single

public float ResolveGridLineWidth(ChartTheme theme)

Returns the explicit grid-line width, or the active theme’s width when no override is set.

Parameters

Name Type
theme ChartGuru.ChartTheme

Returns

System.Single

public int ResolveLabelFontSize(ChartTheme theme)

Returns the explicit label font size, or the active theme’s size when no override is set.

Parameters

Name Type
theme ChartGuru.ChartTheme

Returns

System.Int32

public int ResolveTitleFontSize(ChartTheme theme)

Returns the explicit title font size, or the active theme’s size when no override is set.

Parameters

Name Type
theme ChartGuru.ChartTheme

Returns

System.Int32

public void ResetStyleToBuiltInDefaults(bool inheritFromTheme = true)

Clears explicit axis style overrides, optionally restoring inheritance from the active chart theme.

Parameters

Name Type
inheritFromTheme System.Boolean
public AxisConfig Clone()

Create a copy of this config.

Returns

ChartGuru.AxisConfig

public AxisConfig()

public float MinValue { get; set; }

Returns

System.Single

public float MaxValue { get; set; }

Returns

System.Single

public bool HasCustomDomain { get; }

Returns

System.Boolean

public bool HasExplicitDomain { get; }

Returns

System.Boolean

public bool UsesDefaultDomainFallback { get; }

Returns

System.Boolean

public bool HasRangePadding { get; }

Returns

System.Boolean

public bool UseLogScale { get; set; }

Returns

System.Boolean

public bool HasMarksBlocks { get; }

Returns

System.Boolean

public string LabelFormat { get; set; }

Returns

System.String

public Color AxisColor { get; set; }

Returns

UnityEngine.Color

public bool InheritAxisColor { get; set; }

Returns

System.Boolean

public Color GridLineColor { get; set; }

Returns

UnityEngine.Color

public bool InheritGridLineColor { get; set; }

Returns

System.Boolean

public Color LabelColor { get; set; }

Returns

UnityEngine.Color

public bool InheritLabelColor { get; set; }

Returns

System.Boolean

public float AxisLineWidth { get; set; }

Returns

System.Single

public bool InheritAxisLineWidth { get; set; }

Returns

System.Boolean

public float GridLineWidth { get; set; }

Returns

System.Single

public bool InheritGridLineWidth { get; set; }

Returns

System.Boolean

public int LabelFontSize { get; set; }

Returns

System.Int32

public bool InheritLabelFontSize { get; set; }

Returns

System.Boolean

public int TitleFontSize { get; set; }

Returns

System.Int32

public bool InheritTitleFontSize { get; set; }

Returns

System.Boolean

public AxisScaleType ScaleType { get; set; }

Returns

ChartGuru.AxisScaleType

public bool IsTimeAxis { get; set; }

Returns

System.Boolean

public bool IsBandAxis { get; set; }

Returns

System.Boolean

public Color TickColor { get; set; }

Returns

UnityEngine.Color

public bool InheritTickColor { get; set; }

Returns

System.Boolean