SwiftChartsDefaults
public static class SwiftChartsDefaultsThe Swift Charts defaults the code generator, Swift importer, Swift exporter, mark constructors and ChartBuilder
share, so a value omitted in one is the value the others assume. Each member states its evidence: Swift API
semantics (the case or behavior Apple documents when no modifier is applied), measured from native captures, or not
yet verified against native Swift Charts, in which case the value is Chart Guru's best match until the native
calibration tasks (Tools/ChartGuru3DSwiftPreviews/IMPLEMENTATION_TASKS.md, P1 for 2D) measure it. Chart
Guru's own defaults that Swift Charts does not have live in ChartGuruDefaults.
Fields
Section titled “Fields”
CornerRadius
Section titled “CornerRadius”public const float CornerRadius = 2Bar corner radius in points. Not yet verified against native Swift Charts (calibration task P1).
Returns
System.Single
BarBandRatio
Section titled “BarBandRatio”public const float BarBandRatio = 0.7Share of a category band a bar fills. Not yet verified against native Swift Charts (calibration task P1).
Returns
System.Single
BarSpacing
Section titled “BarSpacing”public const float BarSpacing = 0.42857146Gap between bars relative to a bar, derived from SwiftChartsDefaults.BarBandRatio.
Returns
System.Single
UnitlessBarSize
Section titled “UnitlessBarSize”public const float UnitlessBarSize = 8Width in points of a bar on a continuous axis. Not yet verified against native Swift Charts (calibration task P1).
Returns
System.Single
LineWidth
Section titled “LineWidth”public const float LineWidth = 2Line mark width in points. Not yet verified against native Swift Charts.
Returns
System.Single
SymbolSize
Section titled “SymbolSize”public const float SymbolSize = 8Point symbol diameter in points; Swift Charts sizes symbols by area. Not yet verified against native Swift Charts.
Returns
System.Single
Symbol
Section titled “Symbol”public const SymbolShape Symbol = AutomaticSwift API semantics: marks pick their symbol from the symbol scale.
Returns
ChartGuru.SymbolShape
Interpolation
Section titled “Interpolation”public const InterpolationMethod Interpolation = LinearSwift API semantics: lines and areas connect points with straight segments.
Returns
ChartGuru.InterpolationMethod
StackingMethod
Section titled “StackingMethod”public const MarkStackingMethod StackingMethod = UnstackedThe stacking a parsed mark starts with before the importer applies Swift’s stacking of bars and areas.
Returns
ChartGuru.MarkStackingMethod
InnerRadius
Section titled “InnerRadius”public const float InnerRadius = 0.5Chart Guru’s donut inner radius ratio, not a Swift Charts default: a Swift SectorMark without
innerRadius: draws a pie. Same value as ChartGuruDefaults.DonutInnerRadius, which new code
should use.
Returns
System.Single
ShowAreaLine
Section titled “ShowAreaLine”public const bool ShowAreaLine = falseSwift API semantics: an AreaMark draws no line along its top.
Returns
System.Boolean
LegendPosition
Section titled “LegendPosition”public const LegendPosition LegendPosition = AutomaticSwift API semantics: .chartLegend(position: .automatic).
Returns
ChartGuru.LegendPosition
LegendAlignment
Section titled “LegendAlignment”public const LegendAlignment LegendAlignment = AutomaticSwift API semantics: the legend alignment its position implies.
Returns
ChartGuru.LegendAlignment
AxisPosition
Section titled “AxisPosition”public const AxisPosition AxisPosition = AutoSwift API semantics: AxisMarks(position: .automatic).
Returns
ChartGuru.AxisPosition
AxisTickCount
Section titled “AxisTickCount”public const int AxisTickCount = 5Desired number of axis ticks. Not yet verified against native Swift Charts.
Returns
System.Int32
AutomaticAxisTickCount
Section titled “AutomaticAxisTickCount”public const int AutomaticAxisTickCount = 4Desired number of automatic value-axis ticks. Not yet verified against native Swift Charts.
Returns
System.Int32
AxisTickFormat
Section titled “AxisTickFormat”public const string AxisTickFormat = "F0"Chart Guru’s numeric tick label format, not a Swift Charts value: Swift Charts formats tick labels for the locale automatically.
Returns
System.String
GridLineDash
Section titled “GridLineDash”public static readonly float[] GridLineDashDash pattern in points of band-axis grid lines. Not yet verified against native Swift Charts.
Returns
System.Single[]
GridLineWidth
Section titled “GridLineWidth”public const float GridLineWidth = 0.5Grid line width in points. Not yet verified against native Swift Charts.
Returns
System.Single
Methods
Section titled “Methods”
GetSeriesColor(int)
Section titled “GetSeriesColor(int)”public static Color GetSeriesColor(int index)Returns the default palette color for a wrapping series index. Negative indices resolve to the first color.
Parameters
| Name | Type |
|---|---|
index | System.Int32 |
Returns
UnityEngine.Color
CreateDefaultSeriesColors()
Section titled “CreateDefaultSeriesColors()”public static Color[] CreateDefaultSeriesColors()Returns an independent copy of the default series palette that callers may modify safely.
Returns
UnityEngine.Color[]