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

# chartForegroundStyleScale(mapping:)

Configures the foreground style scale for charts.

## Declaration

```swift
nonisolated func chartForegroundStyleScale<DataValue, S>(mapping: @escaping (DataValue) -> S) -> some View where DataValue : Plottable, S : ShapeStyle

```

## Parameters

- `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(domain:mapping:)](swiftui/view/chartforegroundstylescale(domain: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)
