Skip to content

ForegroundStyleMode

EnumChartGuruChartGuru
public enum ForegroundStyleMode

Controls how ChartGuru.ChartMark.ForegroundStyleKey is assigned to marks in single-series charts. Mirrors Swift Charts’ .ForegroundStyle(by:) modifier.

Automatic = 0

All marks in a single series share the same ForegroundStyleKey (same colour). Matches Swift Charts default when no .ForegroundStyle(by:) is applied.

Returns

ChartGuru.ForegroundStyleMode — No return description is available.

ByCategory = 1

Each mark gets a ForegroundStyleKey derived from its category label, producing per-category colours and a legend. Equivalent to Swift Charts’ .ForegroundStyle(by: .Value(“Category”, item.category)).

Returns

ChartGuru.ForegroundStyleMode — No return description is available.