---
title: "foregroundStyle(for:)"
framework: charts
role: symbol
role_heading: Instance Method
path: "charts/chartproxy/foregroundstyle(for:)"
---

# foregroundStyle(for:)

Returns the foreground style for the given data value. Returns nil if the foreground style scale is unavailable, or the value is invalid.

## Declaration

```swift
func foregroundStyle<P>(for value: P) -> AnyShapeStyle? where P : Plottable
```

## Parameters

- `value`: The data value.

## Return Value

Return Value The foreground style corresponding to the data value, or nil if the data value is incompatible with the chart.
