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

# foregroundStyle(_:)

Represents data using a foreground style.

## Declaration

```swift
nonisolated func foregroundStyle(_ keyPath: KeyPath<Self.DataElement, some ShapeStyle>) -> some VectorizedChartContent<Self.DataElement>

```

## Parameters

- `keyPath`: The accessor for shape style.

## See Also

### Styling marks

- [opacity(_:)](charts/vectorizedchartcontent/opacity(_:).md)
- [lineStyle(_:)](charts/vectorizedchartcontent/linestyle(_:).md)
- [position(by:axis:span:)](charts/vectorizedchartcontent/position(by:axis:span:).md)
