---
title: "chartForegroundStyleScale(domain:mapping:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/chartforegroundstylescale(domain:mapping:)"
---

# chartForegroundStyleScale(domain:mapping:)

Configures the foreground style scale for charts.

## Declaration

```swift
nonisolated func chartForegroundStyleScale<Domain, S>(domain: Domain, mapping: @escaping (Domain.Element) -> S) -> some View where Domain : Collection, S : ShapeStyle, Domain.Element : Plottable

```

## Parameters

- `domain`: The possible data values plotted as foreground style in the chart.
- `mapping`: Maps data categories to foreground styles.

## See Also

### Styles

- [chartBackground(alignment:content:)](swiftui/view/chartbackground(alignment:content:).md)
- [chartForegroundStyleScale(_:)](swiftui/view/chartforegroundstylescale(_:).md)
- [chartForegroundStyleScale(domain:range:type:)](swiftui/view/chartforegroundstylescale(domain:range:type:).md)
- [chartForegroundStyleScale(domain:type:)](swiftui/view/chartforegroundstylescale(domain:type:).md)
- [chartForegroundStyleScale(mapping:)](swiftui/view/chartforegroundstylescale(mapping:).md)
- [chartForegroundStyleScale(range:type:)](swiftui/view/chartforegroundstylescale(range:type:).md)
- [chartForegroundStyleScale(type:)](swiftui/view/chartforegroundstylescale(type:).md)
- [chartPlotStyle(content:)](swiftui/view/chartplotstyle(content:).md)
